Showing the changes to sys/src/cmd/cpp/include.c (1 of 11749 files). Show all
Unified · Split
| @@ -66,7 +66,7 @@ doinclude(Tokenrow *trp) · 65 unmodified lines | ||
| 66 | 66 | write(1,"\n",1); |
| 67 | 67 | } |
| 68 | 68 | if (fd >= 0) { |
| 69 | − if (++incdepth > 10) | |
| 69 | + if (++incdepth > 20) | |
| 70 | 70 | error(FATAL, "#include too deeply nested"); |
| 71 | 71 | setsource((char*)newstring((uchar*)iname, strlen(iname), 0), fd, NULL); |
| 72 | 72 | genline(); |
| @@ -95,6 +95,11 @@ genline(void) · 22 unmodified lines | ||
| 95 | 95 | p += sizeof("#line ")-1; |
| 96 | 96 | p = (uchar*)outnum((char*)p, cursource->line); |
| 97 | 97 | *p++ = ' '; *p++ = '"'; |
| 98 | + if (cursource->filename[0]!='/' && wd[0]) { | |
| 99 | + strcpy((char*)p, wd); | |
| 100 | + p += strlen(wd); | |
| 101 | + *p++ = '/'; | |
| 102 | + } | |
| 98 | 103 | strcpy((char*)p, cursource->filename); |
| 99 | 104 | p += strlen((char*)p); |
| 100 | 105 | *p++ = '"'; *p++ = '\n'; |