mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 22:30:34 +02:00
* fixed off-by-one error in the optimised rawbytestring/unicodestring
dodirseparators() routines + added test (only testable under Windows) git-svn-id: branches/cpstrrtl@25089 -
This commit is contained in:
parent
ba49e4a29d
commit
0ef0206417
@ -1451,7 +1451,7 @@ begin
|
||||
p:=pchar(ps);
|
||||
unique:=true;
|
||||
end;
|
||||
p[i]:=DirectorySeparator;
|
||||
p[i-1]:=DirectorySeparator;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1471,7 +1471,7 @@ begin
|
||||
p:=pwidechar(ps);
|
||||
unique:=true;
|
||||
end;
|
||||
p[i]:=DirectorySeparator;
|
||||
p[i-1]:=DirectorySeparator;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -46,7 +46,36 @@ Begin
|
||||
test(IOResult, 0);
|
||||
WriteLn('Passed!');
|
||||
|
||||
Write('removing directory ...');
|
||||
Write('making subdirectory /testdir3...');
|
||||
mkdir('testdir2/testdir3');
|
||||
test(IOResult, 0);
|
||||
WriteLn('Passed!');
|
||||
|
||||
{$ifdef mswindows}
|
||||
Write('making subdirectory \testdir4...');
|
||||
mkdir('testdir2\testdir4');
|
||||
test(IOResult, 0);
|
||||
WriteLn('Passed!');
|
||||
|
||||
Write('removing directory /testdir3 ...');
|
||||
rmdir('testdir2\testdir3');
|
||||
test(IOResult, 0);
|
||||
WriteLn('Passed!');
|
||||
|
||||
Write('removing directory \testdir4 ...');
|
||||
rmdir('testdir2/testdir4');
|
||||
test(IOResult, 0);
|
||||
WriteLn('Passed!');
|
||||
{$else}
|
||||
{ Unix platforms do not translate \ into / in the system unit *dir functions,
|
||||
regardless of the allowdirectoryseparators setting -> no \ testing }
|
||||
Write('removing directory /testdir3 ...');
|
||||
rmdir('testdir2/testdir3');
|
||||
test(IOResult, 0);
|
||||
WriteLn('Passed!');
|
||||
{$endif}
|
||||
|
||||
Write('removing directory 3 ...');
|
||||
rmdir('testdir2');
|
||||
test(IOResult, 0);
|
||||
WriteLn('Passed!');
|
||||
|
Loading…
Reference in New Issue
Block a user