This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Ada] Fix for xnmake command line processing


The -s/-b switches of nmake do not work as documented.  For example,
"xnmake -s ../xnmake.ads" causes the spec to be written to the file
"xnmake.ads" (the default) and the body to "../xnmake.ads".

In addition, the comment at the beginning of the file contains a few
CVS revision numbers, and if the revision numbers grow, xnmake has
to be changed to output fewer spaces.  (Alternatively, the trailing
spaces and the terminating "--" could be dropped entirely.)  This change
should probably use Ada.Strings.Fixed, but I didn't want to introduce
a dependency on another run-time library unit.

2001-10-10  Florian Weimer  <fw@deneb.enyo.de>

	* xnmake.adb: Fix handling of -s/-b switches.  Improve formatting
	of lines containing CVS revision numbers of varying length.

Index: xnmake.adb
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ada/xnmake.adb,v
retrieving revision 1.1
diff -u -r1.1 xnmake.adb
--- xnmake.adb	2001/10/02 14:57:59	1.1
+++ xnmake.adb	2001/10/10 08:43:33
@@ -249,10 +249,10 @@
 
    elsif Given_File /= Nul then
       if FileS = Nul then
-         FileS := Given_File;
+         FileB := Given_File;
 
       elsif FileB = Nul then
-         FileB := Given_File;
+         FileS := Given_File;
 
       else
          raise Err;
@@ -288,17 +288,17 @@
          WriteBS
            ("--                 Generated by xnmake revision " &
             XNmake_Rev & " using" &
-            "                  --");
+            ((22 - Length (XNMake_Rev)) * V (" ")) & "--");
 
          WriteBS
            ("--                         sinfo.ads revision " &
             Sinfo_Rev &
-            "                         --");
+            ((30 - Length (Sinfo_Rev)) * V (" ")) & "--");
 
          WriteBS
            ("--                         nmake.adt revision " &
             Temp_Rev &
-            "                          --");
+            ((30 - Length (Temp_Rev)) * V (" ")) & "--");
 
       else
          --  Skip lines describing the template


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]