Code

Convert existing die(..., strerror(errno)) to die_errno()
[git.git] / builtin-grep.c
index 5308b346e69a50d7695b26f3b8e00bfdf71e1dd2..e5583686a2daeb05def8358044f49f03ba3acbef 100644 (file)
@@ -594,7 +594,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset)
 
        patterns = fopen(arg, "r");
        if (!patterns)
-               die("'%s': %s", arg, strerror(errno));
+               die_errno("cannot open '%s'", arg);
        while (strbuf_getline(&sb, patterns, '\n') == 0) {
                /* ignore empty line like grep does */
                if (sb.len == 0)
@@ -765,7 +765,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
         * unrecognized non option is the beginning of the refs list
         * that continues up to the -- (if exists), and then paths.
         */
-       argc = parse_options(argc, argv, options, grep_usage,
+       argc = parse_options(argc, argv, prefix, options, grep_usage,
                             PARSE_OPT_KEEP_DASHDASH |
                             PARSE_OPT_STOP_AT_NON_OPTION |
                             PARSE_OPT_NO_INTERNAL_HELP);