[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
match does not work with minus sign
From: |
Paul Romanyszyn |
Subject: |
match does not work with minus sign |
Date: |
Tue, 09 Dec 2008 19:47:54 -0500 |
User-agent: |
Thunderbird 2.0.0.18 (X11/20081125) |
With Ubuntu 7.10 32 bit I found this problem when parsing git-diff
output. I compiled the latest stable version and it also had the
problem. One plus matches one two or three but one minus only matches
one minus.
Test program
BEGIN {
data1 = "+"
data2 = "++"
data3 = "+++"
printf("%d %d
%d\n",match(data1,data1),match(data1,data2),match(data1,data3))
data1 = "-"
data2 = "--"
data3 = "---"
printf("%d %d
%d\n",match(data1,data1),match(data1,data2),match(data1,data3))
}
Output
address@hidden:~/gawksrc$ gawk-3.1.6/gawk -f testmatch.awk
1 1 1
1 0 0
Paul
- match does not work with minus sign,
Paul Romanyszyn <=