From 64d431d98b022d186aa088a295d723b2ec727b84 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 11 Jun 2010 20:08:01 +0000 Subject: 28025: (D) parameter flag --- Src/utils.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index 184b2f354..379f9f738 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -766,6 +766,23 @@ fprintdir(char *s, FILE *f) } } +/* + * Substitute a directory using a name. + * If there is none, return the original argument. + */ + +/**/ +char * +substnamedir(char *s) +{ + Nameddir d = finddir(s); + + if (!d) + return s; + return zhtricat("~", d->node.nam, s + strlen(d->dir)); +} + + /* Returns the current username. It caches the username * * and uid to try to avoid requerying the password files * * or NIS/NIS+ database. */ -- cgit 1.4.1