- Fix bz#2208831, update to 3.10

- Fix bz#2196671, diff -D no longer fails to output #ifndef lines introduced in 3.9
This commit is contained in:
Than Ngo 2023-06-29 13:59:26 +02:00
commit 2b29d95c6c
7 changed files with 52 additions and 69 deletions

View file

@ -1,6 +1,6 @@
diff -up diffutils-3.9/src/diff.c.i18n diffutils-3.9/src/diff.c
--- diffutils-3.9/src/diff.c.i18n 2023-01-02 01:18:33.000000000 +0000
+++ diffutils-3.9/src/diff.c 2023-01-16 14:40:53.841265893 +0000
diff -up diffutils-3.10/src/diff.c.i18n diffutils-3.10/src/diff.c
--- diffutils-3.10/src/diff.c.i18n 2023-05-20 11:17:26.000000000 +0200
+++ diffutils-3.10/src/diff.c 2023-06-29 13:24:19.567608253 +0200
@@ -76,6 +76,8 @@ static _Noreturn void try_help (char con
static void check_stdout (void);
static void usage (void);
@ -10,7 +10,7 @@ diff -up diffutils-3.9/src/diff.c.i18n diffutils-3.9/src/diff.c
/* If comparing directories, compare their common subdirectories
recursively. */
static bool recursive;
@@ -303,6 +305,13 @@ main (int argc, char **argv)
@@ -310,6 +312,14 @@ main (int argc, char **argv)
presume_output_tty = false;
xstdopen ();
@ -20,16 +20,17 @@ diff -up diffutils-3.9/src/diff.c.i18n diffutils-3.9/src/diff.c
+ else
+#endif
+ lines_differ = lines_differ_singlebyte;
+
+
/* Decode the options. */
while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
diff -up diffutils-3.9/src/diff.h.i18n diffutils-3.9/src/diff.h
--- diffutils-3.9/src/diff.h.i18n 2023-01-02 01:18:33.000000000 +0000
+++ diffutils-3.9/src/diff.h 2023-01-16 14:41:58.620317020 +0000
@@ -23,6 +23,17 @@
#include <stdio.h>
#include <unlocked-io.h>
while ((c = getopt_long (argc, argv, shortopts, longopts, nullptr)) != -1)
diff -up diffutils-3.10/src/diff.h.i18n diffutils-3.10/src/diff.h
--- diffutils-3.10/src/diff.h.i18n 2023-05-20 11:37:55.000000000 +0200
+++ diffutils-3.10/src/diff.h 2023-06-29 13:25:49.451271873 +0200
@@ -33,6 +33,17 @@ _GL_INLINE_HEADER_BEGIN
# define XTERN extern
#endif
+/* For platforms which support the ISO C ammendment 1 functionality we
+ support user-defined character classes. */
@ -38,14 +39,14 @@ diff -up diffutils-3.9/src/diff.h.i18n diffutils-3.9/src/diff.h
+# include <wchar.h>
+# include <wctype.h>
+# if defined (HAVE_MBRTOWC)
+# define HANDLE_MULTIBYTE 1
+# define HANDLE_MULTIBYTE 1
+# endif
+#endif
+
/* What kind of changes a hunk contains. */
enum changes
{
@@ -389,7 +400,11 @@ extern void print_sdiff_script (struct c
@@ -392,7 +403,11 @@ extern void print_sdiff_script (struct c
/* util.c */
extern char const change_letter[4];
extern char const pr_program[];
@ -58,9 +59,9 @@ diff -up diffutils-3.9/src/diff.h.i18n diffutils-3.9/src/diff.h
extern lin translate_line_number (struct file_data const *, lin);
extern struct change *find_change (struct change *);
extern struct change *find_reverse_change (struct change *);
diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
--- diffutils-3.9/src/io.c.i18n 2023-01-02 01:18:33.000000000 +0000
+++ diffutils-3.9/src/io.c 2023-01-16 14:40:53.841265893 +0000
diff -up diffutils-3.10/src/io.c.i18n diffutils-3.10/src/io.c
--- diffutils-3.10/src/io.c.i18n 2023-05-20 11:17:26.000000000 +0200
+++ diffutils-3.10/src/io.c 2023-06-29 13:20:52.457820950 +0200
@@ -23,6 +23,7 @@
#include <cmpbuf.h>
#include <file-type.h>
@ -69,7 +70,7 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
/* Rotate an unsigned value to the left. */
#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n)))
@@ -214,6 +215,28 @@ slurp (struct file_data *current)
@@ -223,6 +224,28 @@ slurp (struct file_data *current)
/* Split the file into lines, simultaneously computing the equivalence
class for each line. */
@ -98,7 +99,7 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
static void
find_and_hash_each_line (struct file_data *current)
@@ -240,12 +263,300 @@ find_and_hash_each_line (struct file_dat
@@ -249,12 +272,300 @@ find_and_hash_each_line (struct file_dat
bool same_length_diff_contents_compare_anyway =
diff_length_compare_anyway | ig_case;
@ -399,7 +400,7 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
/* Hash this line until we find a newline. */
switch (ig_white_space)
{
@@ -396,7 +707,7 @@ find_and_hash_each_line (struct file_dat
@@ -405,7 +716,7 @@ find_and_hash_each_line (struct file_dat
else if (!diff_length_compare_anyway)
continue;
@ -408,10 +409,10 @@ diff -up diffutils-3.9/src/io.c.i18n diffutils-3.9/src/io.c
break;
}
diff -up diffutils-3.9/src/util.c.i18n diffutils-3.9/src/util.c
--- diffutils-3.9/src/util.c.i18n 2023-01-02 01:18:33.000000000 +0000
+++ diffutils-3.9/src/util.c 2023-01-16 14:40:53.842265909 +0000
@@ -1084,7 +1084,8 @@ finish_output (void)
diff -up diffutils-3.10/src/util.c.i18n diffutils-3.10/src/util.c
--- diffutils-3.10/src/util.c.i18n 2023-02-19 19:04:39.000000000 +0100
+++ diffutils-3.10/src/util.c 2023-06-29 13:20:52.457820950 +0200
@@ -1085,7 +1085,8 @@ finish_output (void)
Return nonzero if the lines differ. */
bool
@ -421,7 +422,7 @@ diff -up diffutils-3.9/src/util.c.i18n diffutils-3.9/src/util.c
{
register char const *t1 = s1;
register char const *t2 = s2;
@@ -1240,6 +1241,354 @@ lines_differ (char const *s1, char const
@@ -1241,6 +1242,354 @@ lines_differ (char const *s1, char const
return true;
}