[PATCH 5/5] parse-options: use prefix_filename_except_for_dash() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
If we do eventually find that "!file || !*file" is a sign of a bug, we
could perhaps just simplify this whole function away. :)

 parse-options.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/parse-options.c b/parse-options.c
index 25bae8b585b..6dd4c090e03 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(
-- 
2.40.0.rc1.500.g967c04631e



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux