Commit aed2c06d authored by Hector Chu's avatar Hector Chu Committed by Russ Cox

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
parent 08ae1a5a
......@@ -307,6 +307,8 @@ extern int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
extern int fork(void);
extern int pread(int fd, void *buf, int n, int off);
extern int pwrite(int fd, void *buf, int n, int off);
#undef getwd
#define getwd(s, ns) getcwd(s, ns)
#undef lseek
#define lseek(fd, n, base) _lseeki64(fd, n, base)
#define mkdir(path, perm) mkdir(path)
......
......@@ -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;
......
......@@ -460,17 +460,13 @@ outhist(Biobuf *b)
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;
......
......@@ -44,7 +44,11 @@ enum
int
systemtype(int sys)
{
#ifdef _WIN32
return sys&Windows;
#else
return sys&Plan9;
#endif
}
int
......@@ -1251,17 +1255,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;
......
......@@ -331,17 +331,13 @@ outhist(Biobuf *b)
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;
......
......@@ -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;
......
......@@ -330,17 +330,13 @@ outhist(Biobuf *b)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment