[PATCH, libcpp] Quote '#' in file names during dependency generation

Markus Milleder markus.milleder@generali.at
Wed Apr 4 12:04:00 GMT 2007


The following patch makes dependency generation (-M) quote the character '#' in file names.

Patch made against gcc-4.2.0-20070316, but applies cleany to mkdeps.c even in 3.0.
--- libcpp/mkdeps.c.orig        2007-03-31 09:43:09.349996800 +0200
+++ libcpp/mkdeps.c     2007-03-31 09:44:23.927233600 +0200
@@ -79,6 +79,11 @@
          /* '$' is quoted by doubling it.  */
          len++;
          break;
+
+       case '#':
+         /* '#' is quoted with a '\'.  */
+         len++;
+         break;
        }
     }

@@ -100,6 +105,10 @@
          *dst++ = '$';
          break;

+       case '#':
+         *dst++ = '\\';
+         break;
+
        default:
          /* nothing */;
        }


      Markus Milleder




More information about the Gcc-patches mailing list