patch: support "patch [FILE [PATCH]]" format

function                                             old     new   delta
xopen_stdin                                            -      15     +15
patch_main                                          2075    2041     -34

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-08-22 05:39:15 +02:00
parent fd27fa8309
commit e7b0a9e5bc
4 changed files with 56 additions and 12 deletions

View File

@@ -46,3 +46,11 @@ int FAST_FUNC open_or_warn_stdin(const char *filename)
return fd;
}
int FAST_FUNC xopen_stdin(const char *filename)
{
int fd = open_or_warn_stdin(filename);
if (fd >= 0)
return fd;
xfunc_die(); /* We already output an error message. */
}