summaryrefslogtreecommitdiff
path: root/src/cmd/5a/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/5a/lex.c')
-rw-r--r--src/cmd/5a/lex.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/5a/lex.c b/src/cmd/5a/lex.c
index ad7ed05dd..4bef0219a 100644
--- a/src/cmd/5a/lex.c
+++ b/src/cmd/5a/lex.c
@@ -44,7 +44,11 @@ enum
int
systemtype(int sys)
{
+#ifdef _WIN32
+ return sys&Windows;
+#else
return sys&Plan9;
+#endif
}
void
@@ -643,17 +647,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;