]> git.eshelyaron.com Git - emacs.git/commitdiff
(scan_c_file): Save extension position;
authorThien-Thi Nguyen <ttn@gnuvola.org>
Wed, 12 May 2004 21:46:02 +0000 (21:46 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Wed, 12 May 2004 21:46:02 +0000 (21:46 +0000)
use it to get, and later reset, the extension.
[VMS] Modify `filename' in place: trim leading/trailing commas,
and trim trailing "bj" so that extension `obj' is treated like `o'.

lib-src/ChangeLog
lib-src/make-docfile.c

index 0d61f8089cbd84bde59c288da65fecf738383bb1..69a3172c0a34d4ecc6be10e96e6b19f3c38e5380 100644 (file)
@@ -1,3 +1,10 @@
+2004-05-13  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       * make-docfile.c (scan_c_file): Save extension position;
+       use it to get, and later reset, the extension.
+       [VMS] Modify `filename' in place: trim leading/trailing commas,
+       and trim trailing "bj" so that extension `obj' is treated like `o'.
+
 2004-05-12  Thien-Thi Nguyen  <ttn@gnu.org>
 
        * ebrowse.c [VMS] (parse_qualified_param_ident_or_type):
index 27f64145c85dfd32e642efa1a26214188a6e0c02..d8395ac9a9c5b486baeb204b86cbfa031b371fd2 100644 (file)
@@ -348,10 +348,42 @@ scan_c_file (filename, mode)
   register int defvarperbufferflag;
   register int defvarflag;
   int minargs, maxargs;
-  int extension = filename[strlen (filename) - 1];
+  char *extpos;
+  char extension;
+
+#ifdef VMS /* It could be that make-docfile is invoked with comma-separated
+              args (that include the comma for crying out loud!), so we
+              munge object file names a bit to accomodate.  Insert rant on
+              DCL lossage here.  NOTE: This cruft should be strictly
+              confined to the ttn-vms-21-2-stash branch; build methodology
+              for other branches should be improved so that this is not
+              required.  --ttn  */
+
+  /* Ignore trailing comma.  */
+  if (',' == filename[strlen (filename) - 1])
+    filename[strlen (filename) - 1] = '\0';
+
+  /* Ignore trailing "bj" so that ".obj" is considered as ".o" below.  To
+     avoid this kludge we would have to convince MMS (make(1)-like tool
+     under VMS) to support VPATH so that a user-specified .c.o rule would
+     work correctly.  But MMS is proprietary software so any such convincing
+     involves uncountable layers of bureacracy and suit-swimming, just to
+     talk to programmers who may or may not DTRT in the end.  Blech.  */
+  if ('b' == filename[strlen (filename) - 2] &&
+      'j' == filename[strlen (filename) - 1])
+    filename[strlen (filename) - 2] = '\0';
+
+  /* Ignore leading comma.  */
+  if (',' == filename[0])
+    filename++;
+
+#endif /* VMS */
+
+  extpos = filename + strlen (filename) - 1;
+  extension = *extpos;
 
   if (extension == 'o')
-    filename[strlen (filename) - 1] = 'c';
+    *extpos = 'c';
 
   infile = fopen (filename, mode);
 
@@ -363,7 +395,7 @@ scan_c_file (filename, mode)
     }
 
   /* Reset extension to be able to detect duplicate files. */
-  filename[strlen (filename) - 1] = extension;
+  *extpos = extension;
 
   c = '\n';
   while (!feof (infile))