Skip to content

Commit b9286a7

Browse files
committed
rustc: Sanitize names better. Puts out burning tinderbox on OS X.
1 parent 5cbf888 commit b9286a7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/comp/middle/trans.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,20 @@ fn sanitize(str s) -> str {
404404
if (c == ('@' as u8)) {
405405
result += "boxed_";
406406
} else {
407-
auto v = vec(c);
408-
result += _str.from_bytes(v);
407+
if (c == (',' as u8)) {
408+
result += "_";
409+
} else {
410+
if (c == ('{' as u8) || c == ('(' as u8)) {
411+
result += "_of_";
412+
} else {
413+
if (c != 10u8 && c != ('}' as u8) && c != (')' as u8) &&
414+
c != (' ' as u8) && c != ('\t' as u8) &&
415+
c != (';' as u8)) {
416+
auto v = vec(c);
417+
result += _str.from_bytes(v);
418+
}
419+
}
420+
}
409421
}
410422
}
411423
ret result;

0 commit comments

Comments
 (0)