diff options
| author | Junio C Hamano <gitster@pobox.com> | 2017-03-27 10:59:26 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2017-03-27 10:59:26 -0700 |
| commit | a026bde1ac84f90f0b82faa18890b2023c5198d5 (patch) | |
| tree | 8e976b861d4b23904c09bb1fbdd8004f37cb6e6f /diff.c | |
| parent | Merge branch 'jc/lint-runaway-here-doc' (diff) | |
| parent | bundle: use prefix_filename with bundle path (diff) | |
| download | git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.gz git-a026bde1ac84f90f0b82faa18890b2023c5198d5.zip | |
Merge branch 'jk/prefix-filename'
Code clean-up with minor bugfixes.
* jk/prefix-filename:
bundle: use prefix_filename with bundle path
prefix_filename: simplify windows #ifdef
prefix_filename: return newly allocated string
prefix_filename: drop length parameter
prefix_filename: move docstring to header file
hash-object: fix buffer reuse with --path in a subdirectory
Diffstat (limited to 'diff.c')
| -rw-r--r-- | diff.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4023,8 +4023,7 @@ int diff_opt_parse(struct diff_options *options, else if (!strcmp(arg, "--pickaxe-regex")) options->pickaxe_opts |= DIFF_PICKAXE_REGEX; else if ((argcount = short_opt('O', av, &optarg))) { - const char *path = prefix_filename(prefix, strlen(prefix), optarg); - options->orderfile = xstrdup(path); + options->orderfile = prefix_filename(prefix, optarg); return argcount; } else if ((argcount = parse_long_opt("diff-filter", av, &optarg))) { @@ -4071,13 +4070,14 @@ int diff_opt_parse(struct diff_options *options, else if (!strcmp(arg, "--no-function-context")) DIFF_OPT_CLR(options, FUNCCONTEXT); else if ((argcount = parse_long_opt("output", av, &optarg))) { - const char *path = prefix_filename(prefix, strlen(prefix), optarg); + char *path = prefix_filename(prefix, optarg); options->file = fopen(path, "w"); if (!options->file) die_errno("Could not open '%s'", path); options->close_file = 1; if (options->use_color != GIT_COLOR_ALWAYS) options->use_color = GIT_COLOR_NEVER; + free(path); return argcount; } else return 0; |
