X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=builtin-ls-files.c;h=4e1d5af634a1280288d7c8110571f1136343bf3e;hb=289370578ca5833641fbb59813173ac6db1986d1;hp=ac89eb2f770d3b8dbc35ee2c24d9d6c82b8fb6fe;hpb=41dc7e004491725e74e3fdd1c364b4c0a234574b;p=git.git diff --git a/builtin-ls-files.c b/builtin-ls-files.c index ac89eb2f7..4e1d5af63 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -406,7 +406,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) add_exclude(argv[++i], "", 0, &dir.exclude_list[EXC_CMDL]); continue; } - if (!strncmp(arg, "--exclude=", 10)) { + if (!prefixcmp(arg, "--exclude=")) { exc_given = 1; add_exclude(arg+10, "", 0, &dir.exclude_list[EXC_CMDL]); continue; @@ -416,12 +416,12 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) add_excludes_from_file(&dir, argv[++i]); continue; } - if (!strncmp(arg, "--exclude-from=", 15)) { + if (!prefixcmp(arg, "--exclude-from=")) { exc_given = 1; add_excludes_from_file(&dir, arg+15); continue; } - if (!strncmp(arg, "--exclude-per-directory=", 24)) { + if (!prefixcmp(arg, "--exclude-per-directory=")) { exc_given = 1; dir.exclude_per_dir = arg + 24; continue; @@ -434,7 +434,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) error_unmatch = 1; continue; } - if (!strncmp(arg, "--abbrev=", 9)) { + if (!prefixcmp(arg, "--abbrev=")) { abbrev = strtoul(arg+9, NULL, 10); if (abbrev && abbrev < MINIMUM_ABBREV) abbrev = MINIMUM_ABBREV;