summaryrefslogtreecommitdiff
path: root/src/cmd/cc
diff options
context:
space:
mode:
authorSergio Luis O. B. Correia <sergio@larces.uece.br>2009-11-17 09:02:47 -0800
committerSergio Luis O. B. Correia <sergio@larces.uece.br>2009-11-17 09:02:47 -0800
commit0132d8f8034d7e2cae34fdac6796b673340434ce (patch)
tree8d78d67145928787c61ec9929b7c402382f807ac /src/cmd/cc
parent365b808bcbb51293cbb434273bbfecb0f603931c (diff)
downloadgo-0132d8f8034d7e2cae34fdac6796b673340434ce.tar.gz
cmd/cc: Fix -I switch to handle a path with blankspaces correctly
Currently, -I switch can't deal with a path containing spaces. This commit simplify setinclude(), by removing the special case of a string that had spaces. After this change, setinclude() will merely add the given directories to the include path, if it does not yet exist, and this approach works. Will be needed for solving issue 115. R=agl1, rsc, iant2, r http://codereview.appspot.com/155059 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/cc')
-rw-r--r--src/cmd/cc/lex.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/cmd/cc/lex.c b/src/cmd/cc/lex.c
index 428ba55ad..118efd231 100644
--- a/src/cmd/cc/lex.c
+++ b/src/cmd/cc/lex.c
@@ -1517,16 +1517,11 @@ void
setinclude(char *p)
{
int i;
- char *e;
-
- while(*p != 0) {
- e = strchr(p, ' ');
- if(e != 0)
- *e = '\0';
+ if(*p != 0) {
for(i=1; i < ninclude; i++)
if(strcmp(p, include[i]) == 0)
- break;
+ return;
if(i >= ninclude)
include[ninclude++] = p;
@@ -1536,9 +1531,6 @@ setinclude(char *p)
exits("ninclude");
}
- if(e == 0)
- break;
- p = e+1;
}
}