1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-12 10:00:56 +01:00

28025: (D) parameter flag

This commit is contained in:
Peter Stephenson 2010-06-11 20:08:01 +00:00
parent 48fe737779
commit 64d431d98b
4 changed files with 65 additions and 21 deletions

View file

@ -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. */