Skip to content

Commit 502b64f

Browse files
Fixed the blank filename bug
1 parent 1f0ab09 commit 502b64f

6 files changed

Lines changed: 46 additions & 23 deletions

File tree

LazarusSource/DiscImageManager.lpi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
<VersionInfo>
2222
<UseVersionInfo Value="True"/>
2323
<MajorVersionNr Value="1"/>
24-
<MinorVersionNr Value="43"/>
24+
<MinorVersionNr Value="44"/>
2525
<Language Value="0809"/>
26-
<StringTable CompanyName="GJH Software" FileDescription="Disc Image Manager for Acorn and Commodore disc formats" ProductName="Disc Image Manager" ProductVersion="1.43"/>
26+
<StringTable CompanyName="GJH Software" FileDescription="Disc Image Manager for Acorn and Commodore disc formats" ProductName="Disc Image Manager" ProductVersion="1.44"/>
2727
</VersionInfo>
2828
<BuildModes Count="10">
2929
<Item1 Name="Default" Default="True"/>

LazarusSource/DiscImageManager.lps

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
<ComponentName Value="MainForm"/>
2020
<HasResources Value="True"/>
2121
<ResourceBaseClass Value="Form"/>
22-
<IsVisibleTab Value="True"/>
2322
<EditorIndex Value="1"/>
2423
<TopLine Value="543"/>
25-
<CursorPos X="47" Y="3194"/>
24+
<CursorPos X="31" Y="558"/>
2625
<UsageCount Value="200"/>
2726
<Loaded Value="True"/>
2827
<LoadedDesigner Value="True"/>
@@ -31,8 +30,8 @@
3130
<Filename Value="DiscImage.pas"/>
3231
<IsPartOfProject Value="True"/>
3332
<EditorIndex Value="11"/>
34-
<TopLine Value="474"/>
35-
<CursorPos X="12" Y="483"/>
33+
<TopLine Value="61"/>
34+
<CursorPos X="23" Y="4"/>
3635
<UsageCount Value="200"/>
3736
<Loaded Value="True"/>
3837
</Unit2>
@@ -69,8 +68,8 @@
6968
<HasResources Value="True"/>
7069
<ResourceBaseClass Value="Form"/>
7170
<EditorIndex Value="26"/>
72-
<TopLine Value="4"/>
73-
<CursorPos X="24" Y="4"/>
71+
<TopLine Value="76"/>
72+
<CursorPos Y="102"/>
7473
<UsageCount Value="204"/>
7574
<Loaded Value="True"/>
7675
<LoadedDesigner Value="True"/>
@@ -79,17 +78,16 @@
7978
<Filename Value="DiscImageUtils.pas"/>
8079
<IsPartOfProject Value="True"/>
8180
<EditorIndex Value="22"/>
82-
<TopLine Value="88"/>
83-
<CursorPos X="24" Y="138"/>
81+
<CursorPos X="21" Y="4"/>
8482
<UsageCount Value="205"/>
8583
<Loaded Value="True"/>
8684
</Unit6>
8785
<Unit7>
8886
<Filename Value="Global.pas"/>
8987
<IsPartOfProject Value="True"/>
9088
<EditorIndex Value="23"/>
91-
<TopLine Value="212"/>
92-
<CursorPos X="55" Y="50"/>
89+
<TopLine Value="17"/>
90+
<CursorPos X="2" Y="30"/>
9391
<UsageCount Value="216"/>
9492
<Loaded Value="True"/>
9593
</Unit7>
@@ -156,7 +154,7 @@
156154
<Filename Value="SpriteFile.pas"/>
157155
<IsPartOfProject Value="True"/>
158156
<EditorIndex Value="25"/>
159-
<TopLine Value="648"/>
157+
<TopLine Value="647"/>
160158
<CursorPos X="3" Y="495"/>
161159
<UsageCount Value="213"/>
162160
<Loaded Value="True"/>
@@ -266,8 +264,9 @@
266264
</Unit21>
267265
<Unit22>
268266
<Filename Value="DiscImage_ADFS.pas"/>
267+
<IsVisibleTab Value="True"/>
269268
<EditorIndex Value="17"/>
270-
<TopLine Value="228"/>
269+
<TopLine Value="884"/>
271270
<CursorPos X="19" Y="241"/>
272271
<UsageCount Value="102"/>
273272
<Loaded Value="True"/>
@@ -312,7 +311,7 @@
312311
<Unit28>
313312
<Filename Value="DiscImage_CFS.pas"/>
314313
<EditorIndex Value="16"/>
315-
<TopLine Value="513"/>
314+
<TopLine Value="512"/>
316315
<CursorPos X="40" Y="411"/>
317316
<UsageCount Value="114"/>
318317
<Loaded Value="True"/>
@@ -326,7 +325,7 @@
326325
<Unit30>
327326
<Filename Value="DiscImage_Spark.pas"/>
328327
<EditorIndex Value="14"/>
329-
<TopLine Value="73"/>
328+
<TopLine Value="72"/>
330329
<CursorPos X="2" Y="40"/>
331330
<UsageCount Value="100"/>
332331
<Loaded Value="True"/>
@@ -378,7 +377,7 @@
378377
<UsageCount Value="5"/>
379378
</Unit36>
380379
</Units>
381-
<JumpHistory Count="25" HistoryIndex="24">
380+
<JumpHistory Count="29" HistoryIndex="28">
382381
<Position1>
383382
<Filename Value="DiscImage.pas"/>
384383
<Caret Line="494" Column="12" TopLine="476"/>
@@ -479,6 +478,22 @@
479478
<Filename Value="MainUnit.pas"/>
480479
<Caret Line="3197" Column="6" TopLine="3193"/>
481480
</Position25>
481+
<Position26>
482+
<Filename Value="DiscImage.pas"/>
483+
<Caret Line="483" Column="12" TopLine="473"/>
484+
</Position26>
485+
<Position27>
486+
<Filename Value="DiscImageUtils.pas"/>
487+
<Caret Line="138" Column="24" TopLine="88"/>
488+
</Position27>
489+
<Position28>
490+
<Filename Value="DiscImageUtils.pas"/>
491+
<Caret Line="4" Column="21"/>
492+
</Position28>
493+
<Position29>
494+
<Filename Value="Global.pas"/>
495+
<Caret Line="30" Column="2" TopLine="17"/>
496+
</Position29>
482497
</JumpHistory>
483498
<RunParams>
484499
<FormatVersion Value="2"/>

LazarusSource/DiscImageManager.res

0 Bytes
Binary file not shown.

LazarusSource/DiscImageUtils.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
unit DiscImageUtils;
22

33
{
4-
DiscImageUtils V1.43 - part of TDiscImage class
4+
DiscImageUtils V1.44 - part of TDiscImage class
55
66
Copyright (C) 2018-2022 Gerald Holdsworth gerald@hollypops.co.uk
77

LazarusSource/DiscImage_ADFS.pas

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -887,12 +887,17 @@ function TDiscImage.ByteChecksum(offset,size: Cardinal;var buffer:TDIByteArray):
887887
-------------------------------------------------------------------------------}
888888
function TDiscImage.ReadADFSDisc: TDisc;
889889
function ReadTheADFSDisc: TDisc;
890+
type
891+
TVisit = record
892+
Sector : Cardinal;
893+
Name : String;
894+
end;
890895
var
891896
d,ptr,i : Cardinal;
892897
OldName0,
893898
OldName1 : String;
894899
addr : TFragmentArray;
895-
visited : array of Cardinal;
900+
visited : array of TVisit;
896901
begin
897902
//Initialise some variables
898903
root :=$00; //Root address (set to zero so we can id the disc)
@@ -1013,7 +1018,8 @@ function TDiscImage.ReadADFSDisc: TDisc;
10131018
d:=0;
10141019
//Add the root as a visited directory
10151020
SetLength(visited,1);
1016-
visited[0]:=root;
1021+
visited[0].Sector:=root;
1022+
visited[0].Name:=root_name;
10171023
repeat
10181024
//If there are actually any entries
10191025
if Length(Result[d].Entries)>0 then
@@ -1025,7 +1031,8 @@ function TDiscImage.ReadADFSDisc: TDisc;
10251031
//directory we will end up in an infinite loop.
10261032
if Length(visited)>0 then
10271033
for i:=0 to Length(visited)-1 do
1028-
if visited[i]=Result[d].Entries[ptr].Sector then
1034+
if(visited[i].Sector=Result[d].Entries[ptr].Sector)
1035+
and(visited[i].Name=Result[d].Entries[ptr].Filename)then
10291036
Result[d].Entries[ptr].Filename:='';//Blank off the filename so we can remove it later
10301037
//And add them if they are valid
10311038
if Result[d].Entries[ptr].Filename<>'' then
@@ -1044,7 +1051,8 @@ function TDiscImage.ReadADFSDisc: TDisc;
10441051
Result[Length(Result)-1].Parent:=d;
10451052
//Remember it
10461053
SetLength(visited,Length(visited)+1);
1047-
visited[Length(visited)-1]:=Result[d].Entries[ptr].Sector;
1054+
visited[Length(visited)-1].Sector:=Result[d].Entries[ptr].Sector;
1055+
visited[Length(visited)-1].Name:=Result[d].Entries[ptr].Filename;
10481056
//Update the directory reference
10491057
Result[d].Entries[ptr].DirRef:=Length(Result)-1;
10501058
end;

LazarusSource/MainUnit.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ TMainForm = class(TForm)
555555
DesignedDPI = 96;
556556
//Application Title
557557
ApplicationTitle = 'Disc Image Manager';
558-
ApplicationVersion = '1.43';
558+
ApplicationVersion = '1.44';
559559
//Current platform and architecture (compile time directive)
560560
TargetOS = {$I %FPCTARGETOS%};
561561
TargetCPU = {$I %FPCTARGETCPU%};

0 commit comments

Comments
 (0)