From: Jeff King Date: Sat, 4 Mar 2023 10:31:47 +0000 (-0500) Subject: parse-options: use prefix_filename_except_for_dash() helper X-Git-Tag: v2.41.0-rc0~149^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0bbe10313e0b61812082d47431e8648f9df48f15;p=thirdparty%2Fgit.git parse-options: use prefix_filename_except_for_dash() helper Since our fix_filename()'s only remaining special case is handling "-", we can use the newly-minted helper function that handles this already. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/parse-options.c b/parse-options.c index 70f827a073..46fe30ddd4 100644 --- a/parse-options.c +++ b/parse-options.c @@ -63,10 +63,8 @@ static void fix_filename(const char *prefix, char **file) { if (!file || !*file) ; /* leave as NULL */ - else if (!strcmp("-", *file)) - *file = xstrdup(*file); else - *file = prefix_filename(prefix, *file); + *file = prefix_filename_except_for_dash(prefix, *file); } static enum parse_opt_result opt_command_mode_error(