mirror of
https://github.com/golang/go
synced 2024-11-21 23:54:40 -07:00
cc: correct handling of leading ·
R=ken2 CC=golang-dev https://golang.org/cl/193081
This commit is contained in:
parent
531e6b77c8
commit
7263bfc73b
@ -196,7 +196,8 @@ compile(char *file, char **defs, int ndef)
|
|||||||
int i, c, fd[2];
|
int i, c, fd[2];
|
||||||
static int first = 1;
|
static int first = 1;
|
||||||
|
|
||||||
ofile = strdup(file);
|
ofile = alloc(strlen(file)+10);
|
||||||
|
strcpy(ofile, file);
|
||||||
p = utfrrune(ofile, pathchar());
|
p = utfrrune(ofile, pathchar());
|
||||||
if(p) {
|
if(p) {
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
@ -405,9 +406,9 @@ lookup(void)
|
|||||||
int c, n;
|
int c, n;
|
||||||
char *r, *w;
|
char *r, *w;
|
||||||
|
|
||||||
if(symb[0] == 0xc2 && symb[1] == 0xb7) {
|
if((uchar)symb[0] == 0xc2 && (uchar)symb[1] == 0xb7) {
|
||||||
// turn leading · into ""·
|
// turn leading · into ""·
|
||||||
memmove(symb+2, symb, w-symb);
|
memmove(symb+2, symb, strlen(symb)+1);
|
||||||
symb[0] = '"';
|
symb[0] = '"';
|
||||||
symb[1] = '"';
|
symb[1] = '"';
|
||||||
}
|
}
|
||||||
|
@ -223,6 +223,13 @@ lookup(void)
|
|||||||
int c, l;
|
int c, l;
|
||||||
char *r, *w;
|
char *r, *w;
|
||||||
|
|
||||||
|
if((uchar)symb[0] == 0xc2 && (uchar)symb[1] == 0xb7) {
|
||||||
|
// turn leading · into ""·
|
||||||
|
memmove(symb+2, symb, strlen(symb)+1);
|
||||||
|
symb[0] = '"';
|
||||||
|
symb[1] = '"';
|
||||||
|
}
|
||||||
|
|
||||||
// turn · into .
|
// turn · into .
|
||||||
for(r=w=symb; *r; r++) {
|
for(r=w=symb; *r; r++) {
|
||||||
if((uchar)*r == 0xc2 && (uchar)*(r+1) == 0xb7) {
|
if((uchar)*r == 0xc2 && (uchar)*(r+1) == 0xb7) {
|
||||||
@ -232,12 +239,6 @@ lookup(void)
|
|||||||
*w++ = *r;
|
*w++ = *r;
|
||||||
}
|
}
|
||||||
*w++ = '\0';
|
*w++ = '\0';
|
||||||
if(symb[0] == '.') {
|
|
||||||
// turn leading . into "".
|
|
||||||
memmove(symb+2, symb, w-symb);
|
|
||||||
symb[0] = '"';
|
|
||||||
symb[1] = '"';
|
|
||||||
}
|
|
||||||
|
|
||||||
h = 0;
|
h = 0;
|
||||||
for(p=symb; c = *p; p++)
|
for(p=symb; c = *p; p++)
|
||||||
|
Loading…
Reference in New Issue
Block a user