diff options
author | peter <peter@FreeBSD.org> | 1999-12-11 12:24:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-12-11 12:24:21 +0000 |
commit | 784ea5066cbea73d04e8ce5783dd0eb842e3ac1f (patch) | |
tree | 2a59869a343a5d43c01370f1083d67c2a02785a0 /contrib/cvs/src/expand_path.c | |
parent | 308b60f66831aa65a459a7b347ea6ca14b6e4799 (diff) | |
download | FreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.zip FreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.tar.gz |
Import cvs-1.10.7. There are a number of nasty bugs that have been fixed.
Obtained from: cyclic.com
Diffstat (limited to 'contrib/cvs/src/expand_path.c')
-rw-r--r-- | contrib/cvs/src/expand_path.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/cvs/src/expand_path.c b/contrib/cvs/src/expand_path.c index 5cf414e..25e561c 100644 --- a/contrib/cvs/src/expand_path.c +++ b/contrib/cvs/src/expand_path.c @@ -43,7 +43,7 @@ variable_set (nameval) Node *node; p = nameval; - while (isalnum (*p) || *p == '_') + while (isalnum ((unsigned char) *p) || *p == '_') ++p; if (*p != '=') error (1, 0, "illegal character in user variable name in %s", nameval); @@ -133,7 +133,7 @@ expand_path (name, file, line) { if (flag ? *s =='}' - : isalnum (*s) == 0 && *s != '_') + : isalnum ((unsigned char) *s) == 0 && *s != '_') break; doff = d - mybuf; expand_string (&mybuf, &mybuf_size, doff + 1); @@ -214,6 +214,9 @@ expand_path (name, file, line) t = ps->pw_dir; #endif } + if (t == NULL) + error (1, 0, "cannot find home directory"); + doff = d - buf; expand_string (&buf, &buf_size, doff + 1); d = buf + doff; @@ -283,7 +286,7 @@ expand_variable (name, file, line) return Editor; else if (strcmp (name, "USER") == 0) return getcaller (); - else if (isalpha (name[0])) + else if (isalpha ((unsigned char) name[0])) { /* These names are reserved for future versions of CVS, so that is why it is an error. */ |