From eac6d57bef6be699885ee315f34398c08495a6b8 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 12 May 2004 21:46:02 +0000 Subject: [PATCH] (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'. --- lib-src/ChangeLog | 7 +++++++ lib-src/make-docfile.c | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 0d61f8089cb..69a3172c0a3 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,10 @@ +2004-05-13 Thien-Thi Nguyen + + * 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 * ebrowse.c [VMS] (parse_qualified_param_ident_or_type): diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 27f64145c85..d8395ac9a9c 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -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)) -- 2.39.5