summaryrefslogtreecommitdiff
path: root/src/cmd/8a
diff options
context:
space:
mode:
authorHector Chu <hectorchu@gmail.com>2011-09-07 15:49:56 -0400
committerRuss Cox <rsc@golang.org>2011-09-07 15:49:56 -0400
commitaed2c06dcbc21a305fb96418a97fcd935e27272d (patch)
tree3b3d2920271370b321bfca318aa7f81577d4e73a /src/cmd/8a
parent08ae1a5a23e68056dad09ea48e53c4fae36e37b1 (diff)
downloadgo-git-aed2c06dcbc21a305fb96418a97fcd935e27272d.tar.gz
5a, 5c, 6a, 6c, 8a, 8c: fix Windows file paths
Verified with objdump -W. R=alex.brainman, rsc CC=golang-dev https://golang.org/cl/4974061
Diffstat (limited to 'src/cmd/8a')
-rw-r--r--src/cmd/8a/lex.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/8a/lex.c b/src/cmd/8a/lex.c
index 44cfa41f87..ca2e2c138d 100644
--- a/src/cmd/8a/lex.c
+++ b/src/cmd/8a/lex.c
@@ -44,7 +44,11 @@ enum
int
systemtype(int sys)
{
+#ifdef _WIN32
+ return sys&Windows;
+#else
return sys&Plan9;
+#endif
}
int
@@ -912,17 +916,13 @@ outhist(void)
for(h = hist; h != H; h = h->link) {
p = h->name;
op = 0;
- /* on windows skip drive specifier in pathname */
if(systemtype(Windows) && p && p[1] == ':'){
- p += 2;
- c = *p;
- }
- if(p && p[0] != c && h->offset == 0 && pathname){
- /* on windows skip drive specifier in pathname */
+ c = p[2];
+ } else if(p && p[0] != c && h->offset == 0 && pathname){
if(systemtype(Windows) && pathname[1] == ':') {
op = p;
- p = pathname+2;
- c = *p;
+ p = pathname;
+ c = p[2];
} else if(pathname[0] == c){
op = p;
p = pathname;