[PATCH v3 3/5] expand_user_path(): clarify the role of the `real_home` parameter
- From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jul 24, 2021, 22:06 UTC
- Message-ID
- <7b79ba66dd0d43f2565d2cbba268f01d3d36d052.1627164413.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.66.v3.git.1627164413.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
The `real_home` parameter only has an effect when expanding paths starting with `~/`, not when expanding paths starting with `~<user>/`. Let's make that clear.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/path.c b/path.c index 3318ad24336..bf329e535cf 100644 --- a/path.c +++ b/path.c @@ -722,7 +722,7 @@ static struct passwd *getpw_str(const char *username, size_t len) * Return a string with ~ and ~user expanded via getpw*. Returns NULL on getpw * failure or if path is NULL. * - * If real_home is true, strbuf_realpath($HOME) is used in the expansion. + * If real_home is true, strbuf_realpath($HOME) is used in the `~/` expansion. */ char *expand_user_path(const char *path, int real_home) {
-- gitgitgadget