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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 4, 2023 at 05:31 UTC
0bbe10313e0b61812082d47431e8648f9df48f15
1 file changed
+1
-3
parse-options.c
+1
-3
@@ -63,10 +63,8 @@ static void fix_filename(const char *prefix, char **file)
63
{
64
if (!file || !*file)
65
; /* leave as NULL */
66
- else if (!strcmp("-", *file))
67
- *file = xstrdup(*file);
66
else
69
- *file = prefix_filename(prefix, *file);
67
+ *file = prefix_filename_except_for_dash(prefix, *file);
68
}
69
70
static enum parse_opt_result opt_command_mode_error(