Files
haikuports/sys-apps/diffutils/patches/diffutils-3.4.patchset
2016-08-09 18:38:45 +03:00

84 lines
2.3 KiB
Plaintext

From 31c247d91833c10f184f7fb56b5c1cc9beaba20d Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Tue, 9 Aug 2016 18:34:58 +0300
Subject: gcc2 fixes
diff --git a/src/dir.c b/src/dir.c
index c8aa6a5..dc0897e 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -265,6 +265,7 @@ diff_dirs (struct comparison const *cmp,
/* Loop while files remain in one or both dirs. */
while (*names[0] || *names[1])
{
+ int v1;
/* Compare next name in dir 0 with next name in dir 1.
At the end of a dir,
pretend the "next name" in that dir is very large. */
@@ -305,7 +306,7 @@ diff_dirs (struct comparison const *cmp,
}
}
- int v1 = (*handle_file) (cmp,
+ v1 = (*handle_file) (cmp,
0 < nameorder ? 0 : *names[0]++,
nameorder < 0 ? 0 : *names[1]++);
if (val < v1)
@@ -363,7 +364,8 @@ find_dir_file_pathname (char const *dir, char const *file)
match = file; /* longjmp may mess up MATCH. */
else
{
- for (char const **p = dirdata.names; *p; p++)
+ char const **p;
+ for (p = dirdata.names; *p; p++)
if (compare_names (*p, file) == 0)
{
if (file_name_cmp (*p, file) == 0)
diff --git a/src/io.c b/src/io.c
index 410bfef..f0a0622 100644
--- a/src/io.c
+++ b/src/io.c
@@ -281,6 +281,8 @@ find_and_hash_each_line (struct file_data *current)
size_t column = 0;
while ((c = *p++) != '\n')
{
+ size_t repetitions = 1;
+
if (ig_white_space & IGNORE_TRAILING_SPACE
&& isspace (c))
{
@@ -295,8 +297,6 @@ find_and_hash_each_line (struct file_data *current)
while (isspace (c1));
}
- size_t repetitions = 1;
-
if (ig_white_space & IGNORE_TAB_EXPANSION)
switch (c)
{
diff --git a/src/util.c b/src/util.c
index d7b8925..4d0e472 100644
--- a/src/util.c
+++ b/src/util.c
@@ -583,7 +583,7 @@ parse_diff_color (void)
int ind_no; /* Indicator number */
char label[3]; /* Indicator label */
struct color_ext_type *ext; /* Extension we are working on */
-
+ enum parse_state state = PS_START;
if ((p = color_palette) == NULL || *p == '\0')
return;
@@ -596,7 +596,6 @@ parse_diff_color (void)
advance. */
buf = color_buf = xstrdup (p);
- enum parse_state state = PS_START;
while (true)
{
switch (state)
--
2.7.0