summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a91d49c)
raw | patch | inline | side by side (parent: a91d49c)
author | Michael Coleman <tutufan@gmail.com> | |
Wed, 28 Feb 2007 05:44:42 +0000 (23:44 -0600) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 28 Feb 2007 06:02:41 +0000 (22:02 -0800) |
If --file's argument is missing, don't crash. If it cannot be opened,
die with an error message.
Signed-off-by: Junio C Hamano <junkio@cox.net>
die with an error message.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-fmt-merge-msg.c | patch | blob | history |
index 87d3d63ec71ec7f08127085330d28ed28e3f35c7..5be6fb4388e6d1df53de4c06db1acb32d24426c1 100644 (file)
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
else if (!strcmp(argv[1], "--no-summary"))
merge_summary = 0;
else if (!strcmp(argv[1], "-F") || !strcmp(argv[1], "--file")) {
- if (argc < 2)
+ if (argc < 3)
die ("Which file?");
if (!strcmp(argv[2], "-"))
in = stdin;
else {
fclose(in);
in = fopen(argv[2], "r");
+ if (!in)
+ die("cannot open %s", argv[2]);
}
argc--; argv++;
} else