[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with add_exclude_file()

From: Gisle Vanem
Subject: Problem with add_exclude_file()
Date: Mon, 24 May 2021 13:38:59 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

I have an issue with GNU-diff which uses
this Gnulib function 'add_exclude_file()'.

A command like:
  diff -X exclude new old > x.diff
  diff --exclude-from=exclude new old > x.diff

Adding some trace in 'diff.c', I see that 'add_exclude_file()'
returns -1 and 'errno = 22' (EINVAL).

But this works:
  cat exclude | diff --exclude-from=- new old > x.diff

GNU-diff has not changed in ages WRT to this function.

So I patched 'exclude.c' like this:
--- a/lib/exclude.c 2021-03-17 21:03:14
+++ b/lib/exclude.c 2021-05-24 13:33:05
@@ -683,7 +683,7 @@

   if (use_stdin)
     in = stdin;
-  else if (! (in = fopen (file_name, "re")))
+  else if (! (in = fopen (file_name, "r")))
     return -1;

a presto! GNU-diff now works fine. So what is
this mode "re" that fails on Windows?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]