aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-25 22:01:36 +0000
committerRichard Stallman <rms@gnu.org>1992-09-25 22:01:36 +0000
commitb1af4777420641d90fc71bc8f34782d9568b3f01 (patch)
tree10e780538f0870289666b44840f52d6e71cf9161
parent08a6f4b807cc4c420e6df0eaa62f2e31ebbab75b (diff)
downloadgcc-b1af4777420641d90fc71bc8f34782d9568b3f01.zip
gcc-b1af4777420641d90fc71bc8f34782d9568b3f01.tar.gz
gcc-b1af4777420641d90fc71bc8f34782d9568b3f01.tar.bz2
(do_include): "Concatenate" multiple "strings" in #include.
From-SVN: r2248
-rw-r--r--gcc/cccp.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index c22bddc..9b3c95e 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -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. */