diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 52da939316..d47a157ed5 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -3844,12 +3844,12 @@ resourcestring +'exists in this package.'; lisA2PTheUnitnameAlreadyExistsInThePackage = 'The unitname %s%s%s already ' +'exists in the package:%s%s'; + lisA2PFileAlreadyExistsInThePackage = 'File %s%s%s already exists in the package.'; lisA2PAmbiguousUnitName = 'Ambiguous Unit Name'; lisA2PTheUnitNameIsTheSameAsAnRegisteredComponent = 'The unit name %s%s%s ' +'is the same as an registered component.%sUsing this can cause strange ' +'error messages.'; - lisA2PFileAlreadyExistsInThePackage = 'File %s%s%s already exists in the package.'; - lisA2PExistingFile = '%sExisting file: %s%s%s'; + lisA2PExistingFile2 = 'Existing file: %s%s%s'; lisA2PFileAlreadyExists = 'File already exists'; lisA2PFileIsUsed = 'File is used'; lisA2PTheFileIsPartOfTheCurrentProjectItIsABadIdea = 'The file %s%s%s is ' diff --git a/packager/addtopackagedlg.pas b/packager/addtopackagedlg.pas index 82ecd585fc..3fbbb4a178 100644 --- a/packager/addtopackagedlg.pas +++ b/packager/addtopackagedlg.pas @@ -247,6 +247,7 @@ var IDEFileFlags: TIDEFileStateFlags; begin Result:=false; + PkgFile:=Nil; // check if package is readonly if LazPackage.ReadOnly then begin @@ -289,7 +290,7 @@ begin if PkgFile<>nil then begin Msg:=Format(lisA2PFileAlreadyExistsInThePackage, ['"',AFilename,'"']); if PkgFile.Filename<>AFilename then - Msg:=Format(lisA2PExistingFile, [#13, '"', PkgFile.Filename, '"']); + Msg:=Msg+LineEnding+Format(lisA2PExistingFile2, ['"',PkgFile.Filename,'"']); MessageDlg(lisA2PFileAlreadyExists, Msg, mtError, [mbCancel], 0); exit; end; @@ -357,8 +358,6 @@ begin then exit; end; - end else begin - AnUnitName:=''; end; // ok