Commit 122f3980 authored by Dan Sinclair's avatar Dan Sinclair Committed by Russ Cox

ld: handle quoted spaces in package path

Fixes #1087.

R=rsc
CC=golang-dev
https://golang.org/cl/2172041
parent 26fd5252
...@@ -282,7 +282,7 @@ static int ...@@ -282,7 +282,7 @@ static int
parsepkgdata(char *file, char *pkg, char **pp, char *ep, char **prefixp, char **namep, char **defp) parsepkgdata(char *file, char *pkg, char **pp, char *ep, char **prefixp, char **namep, char **defp)
{ {
char *p, *prefix, *name, *def, *edef, *meth; char *p, *prefix, *name, *def, *edef, *meth;
int n; int n, inquote;
// skip white space // skip white space
p = *pp; p = *pp;
...@@ -319,8 +319,19 @@ loop: ...@@ -319,8 +319,19 @@ loop:
// name: a.b followed by space // name: a.b followed by space
name = p; name = p;
while(p < ep && *p != ' ') inquote = 0;
while(p < ep) {
if (*p == ' ' && !inquote)
break;
if(*p == '\\')
p++; p++;
else if(*p == '"')
inquote = !inquote;
p++;
}
if(p >= ep) if(p >= ep)
return -1; return -1;
*p++ = '\0'; *p++ = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment