{"no-ignore", 0, 0, 'i'},
{"show-wiggles",0, 0, 'W'},
{"ignore-blanks",0,0, 'b'},
- {"no-backup", 0, 0, NO_BACKUP },
- {"self-test", 0, 0, SELF_TEST},
+ {"no-backup", 0, 0, NO_BACKUP },
+ {"self-test", 0, 0, SELF_TEST},
{"report-wiggles", 0, 0, REPORT_WIGGLES},
+ {"non-space", 0, 0, NON_SPACE},
{0, 0, 0, 0}
};
"\n"
" --words -w : word-wise diff and merge.\n"
" --lines -l : line-wise diff and merge.\n"
+" --non-space : words are separated by spaces.\n"
"\n"
" --patch -p : treat last file as a patch file.\n"
" -1 -2 -3 : select which component of patch or merge to use.\n"
char *cp2;
int prefix = 0;
- if (type == (ByWord | IgnoreBlanks))
+ if ((type & ByWord) && (type & IgnoreBlanks))
while (cp < end &&
(*cp == ' ' || *cp == '\t')) {
prefix++;
cp++;
break;
case ByWord:
- if (isalnum(*cp) || *cp == '_') {
+ if (*cp == ' ' || *cp == '\t') {
do
cp++;
while (cp < end
- && (isalnum(*cp)
- || *cp == '_'));
- } else if (*cp == ' ' || *cp == '\t') {
+ && (*cp == ' '
+ || *cp == '\t'));
+ } else if ((type & WholeWord) ||
+ isalnum(*cp) || *cp == '_') {
do
cp++;
while (cp < end
- && (*cp == ' '
- || *cp == '\t'));
+ && (((type & WholeWord)
+ && *cp != ' ' && *cp != '\t'
+ && *cp != '\n')
+ || isalnum(*cp)
+ || *cp == '_'));
} else
cp++;
break;
}
cp2 = cp;
- if (type == (ByWord | IgnoreBlanks) &&
+ if ((type & ByWord) && (type & IgnoreBlanks) &&
*start && *start != '\n')
while (cp2 < end &&
(*cp2 == ' ' || *cp2 == '\t' || *cp2 == '\n')) {
Request that all operations and display be word based. This is the
default for the "diff" function.
.TP
+.BR \-\-non\-space
+Request that words be defined as sequences of non-white-space. Without
+this flag words are sequences of alphanumerics or single non-white-space
+characters.
+.TP
.BR \-l ", " \-\-lines
Request that all operations and display be line based.
.TP