diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 2002-04-08 11:04:56 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 2002-04-08 11:04:56 +0000 |
| commit | b00ba4ccbbc47007464062814d062702e3123276 (patch) | |
| tree | 43239812dcfdcb11364d9f2833b861bce4338e8b /lib/libutil/login_class.c | |
| parent | 6db4dfa90fb9cdc04e76f74559c75e5fa8f3db92 (diff) | |
Notes
Diffstat (limited to 'lib/libutil/login_class.c')
| -rw-r--r-- | lib/libutil/login_class.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index b8b956b43f5f..dfd2d2cb1e03 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -126,7 +126,7 @@ static struct login_vars { }; static char * -substvar(char * var, const struct passwd * pwd, int hlen, int pch, int nlen) +substvar(const char * var, const struct passwd * pwd, int hlen, int pch, int nlen) { char *np = NULL; @@ -137,12 +137,10 @@ substvar(char * var, const struct passwd * pwd, int hlen, int pch, int nlen) if (pwd != NULL) { /* Count the number of ~'s in var to substitute */ - p = var; - for (p = var; (p = strchr(p, '~')) != NULL; p++) + for (p = (char *)var; (p = strchr(p, '~')) != NULL; p++) ++tildes; /* Count the number of $'s in var to substitute */ - p = var; - for (p = var; (p = strchr(p, '$')) != NULL; p++) + for (p = (char *)var; (p = strchr(p, '$')) != NULL; p++) ++dollas; } @@ -197,8 +195,8 @@ setclassenvironment(login_cap_t *lc, const struct passwd * pwd, int paths) ++pch; while (vars->tag != NULL) { - char * var = paths ? login_getpath(lc, vars->tag, NULL) - : login_getcapstr(lc, vars->tag, NULL, NULL); + const char * var = paths ? login_getpath(lc, vars->tag, NULL) + : login_getcapstr(lc, vars->tag, NULL, NULL); char * np = substvar(var, pwd, hlen, pch, nlen); |
