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>
This commit is contained in:

committed by
Junio C Hamano

parent
7ce4088ab7
commit
0bbe10313e
@ -63,10 +63,8 @@ static void fix_filename(const char *prefix, char **file)
|
|||||||
{
|
{
|
||||||
if (!file || !*file)
|
if (!file || !*file)
|
||||||
; /* leave as NULL */
|
; /* leave as NULL */
|
||||||
else if (!strcmp("-", *file))
|
|
||||||
*file = xstrdup(*file);
|
|
||||||
else
|
else
|
||||||
*file = prefix_filename(prefix, *file);
|
*file = prefix_filename_except_for_dash(prefix, *file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum parse_opt_result opt_command_mode_error(
|
static enum parse_opt_result opt_command_mode_error(
|
||||||
|
Reference in New Issue
Block a user