ports/textproc/patchutils/patches/patch-src_rediff_c

14 lines
428 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Avoid use of unitialized variable. Fixes addhunk2 test with vm.malloc_conf=J.
Index: src/rediff.c
--- src/rediff.c.orig
+++ src/rediff.c
@@ -842,6 +842,7 @@ static int rediff (const char *original, const char *e
newhunk->filepos = pos;
newhunk->line_in_diff = linenum;
newhunk->num_lines = 0;
+ newhunk->discard_offset = 0;
if (!strncmp (line, "--- ", 4)) {
struct file_info *info = xmalloc (sizeof *info);