View Issue Details

IDProjectCategoryView StatusLast Update
0033150FPCPackagespublic2018-03-09 15:10
ReporterOleksii PyrogovAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
PlatformanyOSanyOS Version
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033150: possible duplication temporary file name in paszlib
Descriptionpackage: paszlib
unit: zipper.pp
method: TZipper.ZipOneFile
Additional InformationI propose patch
TagsNo tags attached.
Fixed in Revision38304.
FPCOldBugId
FPCTarget
Attached Files
  • zipper.pp.diff (452 bytes)
    1742c1742,1743
    <   TmpFileName : String;
    ---
    >   TmpFileName, Start : String;
    >   I : Integer;
    1752,1754c1753,1758
    <       TmpFileName:=ChangeFileExt(FFileName,'.tmp');
    <       if TmpFileName=FFileName then
    <         TmpFileName:=TmpFileName+'.tmp';
    ---
    >       Start := ChangeFileExt(FFileName, '');
    >       I := 0;
    >       repeat
    >         TmpFileName := Format('%s%.5d.tmp', [Start, I]);
    >         Inc(I);
    >       until not FileExists(TmpFileName);
    
    zipper.pp.diff (452 bytes)

Activities

Oleksii Pyrogov

2018-02-10 12:00

reporter  

zipper.pp.diff (452 bytes)
1742c1742,1743
<   TmpFileName : String;
---
>   TmpFileName, Start : String;
>   I : Integer;
1752,1754c1753,1758
<       TmpFileName:=ChangeFileExt(FFileName,'.tmp');
<       if TmpFileName=FFileName then
<         TmpFileName:=TmpFileName+'.tmp';
---
>       Start := ChangeFileExt(FFileName, '');
>       I := 0;
>       repeat
>         TmpFileName := Format('%s%.5d.tmp', [Start, I]);
>         Inc(I);
>       until not FileExists(TmpFileName);
zipper.pp.diff (452 bytes)

Juha Manninen

2018-02-20 13:03

reporter   ~0106479

How is one supposed to apply the patch? The "patch" command says:
 $ patch -p0 < ~/patch/zipper.pp.diff
 patch: **** Only garbage was found in the patch input.

There is a function for a unique temp filename somewhere. It could be used here.

Michael Van Canneyt

2018-02-21 11:31

administrator   ~0106510

The patch can be applied easily:
patch zipper.pp <~/Documents/zipper.pp.diff

Michael Van Canneyt

2018-02-21 11:33

administrator   ~0106511

Thanks for the patch, applied.

Oleksii Pyrogov

2018-03-09 15:10

reporter   ~0107051

thank you

Issue History

Date Modified Username Field Change
2018-02-10 12:00 Oleksii Pyrogov New Issue
2018-02-10 12:00 Oleksii Pyrogov File Added: zipper.pp.diff
2018-02-10 12:47 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-02-10 12:47 Michael Van Canneyt Status new => assigned
2018-02-20 13:03 Juha Manninen Note Added: 0106479
2018-02-21 11:31 Michael Van Canneyt Note Added: 0106510
2018-02-21 11:32 Michael Van Canneyt Fixed in Revision => 38304.
2018-02-21 11:32 Michael Van Canneyt LazTarget => -
2018-02-21 11:32 Michael Van Canneyt Status assigned => resolved
2018-02-21 11:32 Michael Van Canneyt Resolution open => fixed
2018-02-21 11:32 Michael Van Canneyt Project Patches => FPC
2018-02-21 11:32 Michael Van Canneyt Product Version 1.8 =>
2018-02-21 11:33 Michael Van Canneyt Fixed in Version => 3.1.1
2018-02-21 11:33 Michael Van Canneyt Target Version => 3.2.0
2018-02-21 11:33 Michael Van Canneyt Note Added: 0106511
2018-03-09 15:10 Oleksii Pyrogov Note Added: 0107051
2018-03-09 15:10 Oleksii Pyrogov Status resolved => closed