diffutils/diffutils-3.12-sdiff-continue-break.patch
Than Ngo f07f8c37a4 - Upstream patches
* cross compile build of 3.12 diffutils fails
  * sdiff: continue → break
  * sdiff: pacify gcc -flto -Wmaybe-uninitialized
  * sdiff: port back to C17
2025-05-05 13:19:21 +02:00

65 lines
2 KiB
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

commit 80053ab7b57c1f0825deb4a22018dacfa62d7272
Author: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed Apr 23 11:17:53 2025 -0700
sdiff: continue → break
* src/sdiff.c (edit): Dont use continue when a simple
break from the switch will do.
diff --git a/src/sdiff.c b/src/sdiff.c
index 7734a82..5b1b162 100644
--- a/src/sdiff.c
+++ b/src/sdiff.c
@@ -872,13 +872,13 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
{
case '1': case '2': case 'l': case 'r':
case 's': case 'v': case 'q':
- if (skip_white () != '\n')
+ if (skip_white () == '\n')
+ gotcmd = true;
+ else
{
give_help ();
flush_line ();
- continue;
}
- gotcmd = true;
break;
case 'e':
@@ -886,13 +886,13 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
switch (cmd1)
{
case '1': case '2': case 'b': case 'd': case 'l': case 'r':
- if (skip_white () != '\n')
+ if (skip_white () == '\n')
+ gotcmd = true;
+ else
{
give_help ();
flush_line ();
- continue;
}
- gotcmd = true;
break;
case '\n':
gotcmd = true;
@@ -900,7 +900,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
default:
give_help ();
flush_line ();
- continue;
+ break;
}
break;
@@ -917,7 +917,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
FALLTHROUGH;
case '\n':
give_help ();
- continue;
+ break;
}
}