Bug#636029: Patch works after adjustment of line numbers
Patch is working, after adjusting the lines numbers (for a linux source that is provided by a Debian source package):
$ patch --dry-run --verbose scripts/kconfig/conf.c ../636029.patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- a/scripts/kconfig/conf.c
|+++ b/scripts/kconfig/conf.c
--------------------------
Patching file scripts/kconfig/conf.c using Plan A...
Hunk #1 succeeded at 38.
Hunk #2 FAILED at 110.
Hunk #3 FAILED at 467.
Hunk #4 FAILED at 573.
3 out of 4 hunks FAILED -- saving rejects to file scripts/kconfig/conf.c.rej
Hmm... Ignoring the trailing garbage.
done
$ patch --dry-run --verbose scripts/kconfig/conf.c ../conf.c.patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- scripts/kconfig/conf.c 2011-07-31 14:09:19.000000000 +0300
|+++ ../conf.c 2011-07-31 14:15:39.000000000 +0300
--------------------------
Patching file scripts/kconfig/conf.c using Plan A...
Hunk #1 succeeded at 38.
Hunk #2 succeeded at 110.
Hunk #3 succeeded at 492.
Hunk #4 succeeded at 600.
done
$ cat ../conf.c.patch
--- scripts/kconfig/conf.c 2011-07-31 14:09:19.000000000 +0300
+++ ../conf.c 2011-07-31 14:15:39.000000000 +0300
@@ -38,6 +38,7 @@ enum input_mode {
char *defconfig_file;
static int indent = 1;
+static int tty_stdio;
static int valid_stdin = 1;
static int sync_kconfig;
static int conf_cnt;
@@ -109,6 +110,8 @@ static int conf_askvalue(struct symbol *
case oldaskconfig:
fflush(stdout);
xfgets(line, 128, stdin);
+ if (!tty_stdio)
+ printf("\n");
return 1;
default:
break;
@@ -489,6 +492,8 @@ int main(int ac, char **av)
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ tty_stdio = isatty(0) && isatty(1) && isatty(2);
+
while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
input_mode = (enum input_mode)opt;
switch (opt) {
@@ -595,7 +600,7 @@ int main(int ac, char **av)
return 1;
}
}
- valid_stdin = isatty(0) && isatty(1) && isatty(2);
+ valid_stdin = tty_stdio;
}
switch (input_mode) {
Reply to: