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:
parent
48fe737779
commit
64d431d98b
4 changed files with 65 additions and 21 deletions
17
Src/utils.c
17
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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue