bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Backslashes for quoting colons in dependencies not removed


From: Theo Markettos
Subject: Backslashes for quoting colons in dependencies not removed
Date: Wed, 23 Feb 2005 22:19:06 +0000
User-agent: Mutt/1.3.28i

I've run into exactly the same problem as a decade-old bug report - that
backslashes escaped by colons in dependencies aren't removed.  Rather than
repeating it, I refer you to the 1995 bug report which still fails in 3.80:

http://groups-beta.google.com/group/gnu.utils.bug/msg/9cafcf265b47c763
 Subject: bug&fix: backslashes for quoting colons in dependencies not removed
 From: Tony Silva
 Date: Nov 17 1995, 12:00 am 

The patch forward-ported to 3.80 is below, which seems to do the trick. 
(though I'm not completely sure that strcpy isn't going to buffer overrun -
that string could always be realloced by one byte longer)

This never received a reply at the time - any thoughts this time around?

Thanks
Theo

--- old/make-3.80/read.c        2002-10-04 03:13:42.000000000 +0100
+++ make-3.80/read.c    2005-02-23 22:03:04.000000000 +0000
@@ -1155,6 +1155,19 @@
         deps = (struct dep *)
           multi_glob (parse_file_seq (&p2, '|', sizeof (struct dep), 1),
                       sizeof (struct dep));
+        {
+          struct dep *d;
+          char *p;
+
+          for (d = deps; d!=0; d = d->next)
+          /* unquote backslashed (escaped)colons in
+           * each dependency name
+           */
+            for (p = d->name; *p; p++)
+              if (*p == '\\' && p[1] == ':')
+                strcpy(p, p+1);
+
+        }
         if (*p2)
           {
             /* Files that follow '|' are special prerequisites that
-----


-- 
Theo Markettos                 address@hidden
Clare Hall, Cambridge          address@hidden
CB3 9AL, UK                    http://www.markettos.org.uk/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]