GNU bug report logs - #79240
Space inside C-strings

Previous Next

Package: diffutils;

Reported by: Gisle Vanem <gvanem <at> yahoo.no>

Date: Fri, 15 Aug 2025 08:28:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Gisle Vanem <gvanem <at> yahoo.no>
To: 79240 <at> debbugs.gnu.org
Subject: bug#79240: Space inside C-strings
Date: Fri, 15 Aug 2025 10:27:06 +0200
I seem that "diff --ignore-space-change file1 file2"
ignores space-changes *inside* a C-string.

Like with file-1.c:
  char strFl[7] = "  ";
  char strTt[5] = "  ";
  char strGs[5] = "  ";

and file-2.c:
  char strFl[7] = " ";
  char strTt[5] = " ";
  char strGs[5] = " ";

"diff.exe -u3 -b file-1.c file-2.c" gives nothing.

I think this case should be OK for
"--ignore-all-space", not "-b" or "--ignore-space-change".
The manual does not mention spaces inside ""-strings AFAICS.

So how can I use diff to *not* ignore spaces inside C-stings,
but ignore trailing/leading spaces? A regular expression?

-- 
--gv




This bug report was last modified 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.