(do_include): "Concatenate" multiple "strings" in #include.
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Sep 1992 22:01:36 +0000 (22:01 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Sep 1992 22:01:36 +0000 (22:01 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2248 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cccp.c

index c22bddc..9b3c95e 100644 (file)
@@ -3672,11 +3672,29 @@ get_filename:
 
   switch (*fbeg++) {
   case '\"':
-    fend = fbeg;
-    while (fend != limit && *fend != '\"')
-      fend++;
-    if (*fend == '\"' && fend + 1 == limit) {
+    {
       FILE_BUF *fp;
+      /* Copy the operand text, concatenating the strings.  */
+      {
+       U_CHAR *fin = fbeg;
+       fbeg = (U_CHAR *) alloca (limit - fbeg + 1);
+       fend = fbeg;
+       while (fin != limit) {
+         while (fin != limit && *fin != '\"')
+           *fend++ = *fin++;
+         fin++;
+         if (fin == limit)
+           break;
+         /* If not at the end, there had better be another string.  */
+         /* Skip just horiz space, and don't go past limit.  */
+         while (fin != limit && is_hor_space[*fin]) fin++;
+         if (fin != limit && *fin == '\"')
+           fin++;
+         else
+           goto fail;
+       }
+      }
+      *fend++ = 0;
 
       /* We have "filename".  Figure out directory this source
         file is coming from and put it on the front of the list. */