Skip to content

Commit 6e7fda2

Browse files
committed
use nodup + mkpathdup
1 parent d692a9d commit 6e7fda2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

builtin/am.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,8 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
861861
if (*sb.buf == '#')
862862
continue; /* skip comment lines */
863863

864-
strvec_push(&patches, mkpath("%s/%s", series_dir, sb.buf));
864+
strvec_push_nodup(&patches,
865+
mkpathdup("%s/%s", series_dir, sb.buf));
865866
}
866867

867868
fclose(fp);
@@ -2516,7 +2517,8 @@ int cmd_am(int argc,
25162517
if (is_absolute_path(argv[i]) || !prefix)
25172518
strvec_push(&paths, argv[i]);
25182519
else
2519-
strvec_push(&paths, mkpath("%s/%s", prefix, argv[i]));
2520+
strvec_push_nodup(&paths,
2521+
mkpathdup("%s/%s", prefix, argv[i]));
25202522
}
25212523

25222524
if (state.interactive && !paths.nr)

0 commit comments

Comments
 (0)