]> git.ipfire.org Git - thirdparty/git.git/blobdiff - grep.c
use xstrdup_or_null to replace ternary conditionals
[thirdparty/git.git] / grep.c
diff --git a/grep.c b/grep.c
index 99217dc04f5d04c761f094069f1053cb090baaf1..f48a648a0d673e5acecef19288b608cc0049659d 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -1646,8 +1646,8 @@ void grep_source_init(struct grep_source *gs, enum grep_source_type type,
                      const void *identifier)
 {
        gs->type = type;
-       gs->name = name ? xstrdup(name) : NULL;
-       gs->path = path ? xstrdup(path) : NULL;
+       gs->name = xstrdup_or_null(name);
+       gs->path = xstrdup_or_null(path);
        gs->buf = NULL;
        gs->size = 0;
        gs->driver = NULL;