@@ -126,7 +126,7 @@ dotdot:
}
}
if (!*dest)
- dest = ".";
+ dest = dotdir;
path = bltinlookup("CDPATH");
while (p = path, (len = padvance_magic(&path, dest, 0)) >= 0) {
c = *p;
@@ -1358,7 +1358,7 @@ expmeta(char *name, unsigned name_len, unsigned expdir_len)
cp = expdir;
expdir_len = enddir - cp;
if (!expdir_len)
- cp = ".";
+ cp = dotdir;
if ((dirp = opendir(cp)) == NULL)
return;
if (*endname == 0) {
@@ -68,6 +68,7 @@ const char cqchars[] = {
};
const char illnum[] = "Illegal number: %s";
const char homestr[] = "HOME";
+const char dotdir[] = ".";
/*
* equal - #defined in mystring.h
@@ -57,6 +57,7 @@ extern const char cqchars[];
#define qchars (cqchars + 1)
extern const char illnum[];
extern const char homestr[];
+extern const char dotdir[];
#if 0
void scopyn(const char *, char *, int);
@@ -143,7 +143,7 @@ INIT {
p = lookupvar("PWD");
if (p)
- if (*p != '/' || stat64(p, &st1) || stat64(".", &st2) ||
+ if (*p != '/' || stat64(p, &st1) || stat64(dotdir, &st2) ||
st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino)
p = 0;
setpwd(p, 0);
Merge all occurrences of "." into dotdir. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> --- src/cd.c | 2 +- src/expand.c | 2 +- src/mystring.c | 1 + src/mystring.h | 1 + src/var.c | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-)