View Issue Details

IDProjectCategoryView StatusLast Update
0037071FPCRTLpublic2020-05-18 15:16
ReporterLadislav Lacina Assigned To 
Status newResolutionopen 
Product Version3.3.1 
Summary0037071: Wrong processing of relative file paths in TDOSStream (at least in GO32V2)
DescriptionIt seems that the file streams from unit Objects do something wrong with relative paths.
Look at this simple source:

[code]program teststrm;
uses objects;
var s:TDosStream;

If you have existing .\SUBDIR\ and file "FILE.TXT" inside it should print 0 and 0.
But it prints -2 and 3 which means "Invalid file path."

Compiled with FPC 1.0.10 it works as expected.
Steps To ReproduceUsualy but not in 100% cases it behaves wrongly but very rarely it works OK. Some undefined variable working only when the value is in default value?
TagsNo tags attached.
Fixed in Revision
Attached Files


Ladislav Lacina

2020-05-14 10:24

reporter   ~0122786

Last edited: 2020-05-14 10:27

View 2 revisions

It seems that the root of the bug are in the function FExpand in the unit DOS and in function GetDir too.

Ladislav Lacina

2020-05-14 20:39

reporter   ~0122802

Hm, bad...
This bug occur only from IDE.
If I leave the IDE and run the generated EXE everything is OK.
It will be hard to debug...

Jonas Maebe

2020-05-14 21:48

manager   ~0122806

Can't you set the working directory that the IDE should use to run a program?

Ladislav Lacina

2020-05-18 15:16

reporter   ~0122903

No, it does not look like the accidental change of the working direktory in IDE. When I open the "Open file" dialog I can see the files from my C:\PASCAL\PROJECTS\EDITOR\ direktory. The same when I shell into DOS. I am still in C:\PASCAL\PROJECTS\EDITOR\
Better for debugging is the function GetDir.
For all my drives it returns the root direktory. (like C:\, A:\)
I plan to make test - to write a simple own implementation of GetDir to diferenciate between buggy code of System.GetDir and buggy behaviour of IDE.

Issue History

Date Modified Username Field Change
2020-05-14 10:14 Ladislav Lacina New Issue
2020-05-14 10:24 Ladislav Lacina Note Added: 0122786
2020-05-14 10:27 Ladislav Lacina Note Edited: 0122786 View Revisions
2020-05-14 20:39 Ladislav Lacina Note Added: 0122802
2020-05-14 21:48 Jonas Maebe Note Added: 0122806
2020-05-18 15:16 Ladislav Lacina Note Added: 0122903