1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:10:21 -07:00

ld: handle quoted spaces in package path

Fixes #1087.

R=rsc
CC=golang-dev
https://golang.org/cl/2172041
This commit is contained in:
Dan Sinclair 2010-09-10 13:59:20 -04:00 committed by Russ Cox
parent 26fd5252f4
commit 122f3980c7

View File

@ -282,7 +282,7 @@ static int
parsepkgdata(char *file, char *pkg, char **pp, char *ep, char **prefixp, char **namep, char **defp)
{
char *p, *prefix, *name, *def, *edef, *meth;
int n;
int n, inquote;
// skip white space
p = *pp;
@ -319,8 +319,19 @@ loop:
// name: a.b followed by space
name = p;
while(p < ep && *p != ' ')
inquote = 0;
while(p < ep) {
if (*p == ' ' && !inquote)
break;
if(*p == '\\')
p++;
else if(*p == '"')
inquote = !inquote;
p++;
}
if(p >= ep)
return -1;
*p++ = '\0';