patch: if reading fails, do not go into infinite loop asking for a filename.
This can happen if no tty is available. Obtained from: OpenBSD (CVS rev 1.54) MFC after: 5 days
This commit is contained in:
parent
864092bcaa
commit
12300d3aa0
|
@ -216,8 +216,10 @@ there_is_another_patch(void)
|
|||
filearg[0] = fetchname(buf, &exists, 0);
|
||||
}
|
||||
if (!exists) {
|
||||
ask("No file found--skip this patch? [n] ");
|
||||
if (*buf != 'y')
|
||||
int def_skip = *bestguess == '\0';
|
||||
ask("No file found--skip this patch? [%c] ",
|
||||
def_skip ? 'y' : 'n');
|
||||
if (*buf == 'n' || (!def_skip && *buf != 'y'))
|
||||
continue;
|
||||
if (verbose)
|
||||
say("Skipping patch...\n");
|
||||
|
|
Loading…
Reference in New Issue