mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-30 20:22:37 +02:00
Codetools,IDE: Allow renaming project files to lowercase in a case-insensitive file system. Issue #10370.
This commit is contained in:
parent
e9e8f61f5a
commit
3d47bef87e
@ -749,9 +749,10 @@ end;
|
||||
function TCodeCache.CreateFile(const AFilename: string): TCodeBuffer;
|
||||
begin
|
||||
Result:=FindFile(AFileName);
|
||||
if Result<>nil then begin
|
||||
Result.Clear;
|
||||
end else begin
|
||||
// Create a new buffer also when only char case differs in names.
|
||||
if (Result<>nil) and (Result.Filename=AFilename) then
|
||||
Result.Clear
|
||||
else begin
|
||||
Result:=TCodeBuffer.Create;
|
||||
Result.FileName:=AFileName;
|
||||
FItems.Add(Result);
|
||||
|
@ -6024,7 +6024,7 @@ begin
|
||||
// check if file is already lowercase (or it does not matter in current OS)
|
||||
OldShortFilename:=ExtractFilename(OldFilename);
|
||||
NewShortFilename:=lowercase(OldShortFilename);
|
||||
if CompareFilenames(OldShortFilename,NewShortFilename)=0 then exit;
|
||||
if OldShortFilename=NewShortFilename then exit;
|
||||
// create new filename
|
||||
NewFilename:=ExtractFilePath(OldFilename)+NewShortFilename;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user