Use a better name for the function interpolating paths
It is not immediately clear what `expand_user_path()` means, so let's rename it to `interpolate_path()`. This also opens the path for interpolating more than just a home directory. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
644e6b2c0f
commit
a03b097d63
4
path.c
4
path.c
@ -724,7 +724,7 @@ static struct passwd *getpw_str(const char *username, size_t len)
|
||||
*
|
||||
* If real_home is true, strbuf_realpath($HOME) is used in the `~/` expansion.
|
||||
*/
|
||||
char *expand_user_path(const char *path, int real_home)
|
||||
char *interpolate_path(const char *path, int real_home)
|
||||
{
|
||||
struct strbuf user_path = STRBUF_INIT;
|
||||
const char *to_copy = path;
|
||||
@ -811,7 +811,7 @@ const char *enter_repo(const char *path, int strict)
|
||||
strbuf_add(&validated_path, path, len);
|
||||
|
||||
if (used_path.buf[0] == '~') {
|
||||
char *newpath = expand_user_path(used_path.buf, 0);
|
||||
char *newpath = interpolate_path(used_path.buf, 0);
|
||||
if (!newpath)
|
||||
return NULL;
|
||||
strbuf_attach(&used_path, newpath, strlen(newpath),
|
||||
|
Reference in New Issue
Block a user