When the Project Manager is indicating that a directory cannot be created
and the full path name of the directory contains chacters that are
teated specially to modify the error message, the full path name of the
directory is not displayed correctly. This patch corrects the problem.
Tested on x86_64-pc-linux-gnu, committed on trunk
2014-07-30 Vincent Celier <[email protected]>
* errutil.adb (Set_Msg_Text): Process tilde ('~'): no processing
of error message.
* prj-nmsc.adb (Locate_Directory): Use a tilde ('~') in the
message to report that a directory cannot be created, to avoid
processing of the directory path that may contains special
insertion characters.
Index: prj-nmsc.adb
===================================================================
--- prj-nmsc.adb (revision 213283)
+++ prj-nmsc.adb (working copy)
@@ -6214,7 +6214,7 @@
when Use_Error =>
Error_Msg
(Data.Flags,
- "could not create " & Create &
+ "~could not create " & Create &
" directory " & Full_Path_Name.all,
Location, Project);
end;
Index: errutil.adb
===================================================================
--- errutil.adb (revision 213263)
+++ errutil.adb (working copy)
@@ -772,6 +772,13 @@
P := P - 1;
Set_Msg_Insertion_Reserved_Word (Text, P);
+ -- Tilde: just remove '~' and do not modify the message further
+
+ elsif C = '~' then
+ Set_Msg_Str
+ (Text (Text'First .. P - 2) & Text (P .. Text'Last));
+ exit;
+
-- Normal character with no special treatment
else