bug-gnu-utils
[Top][All Lists]
Advanced

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

Gawk match() strange behaviour


From: Alain Ketterlin
Subject: Gawk match() strange behaviour
Date: Wed, 11 Jul 2007 18:44:56 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.1.4) / FreeBSD-6.2


Hi,

The following program:

{
    r = match($0,/^ */,t);
    print "R=" r " S=" RSTART " L=" RLENGTH;
}

produces this (< signals  input, > signals output)

<
R=-1208966831 S=-1208966831 L=1208966850
< random
R=1 S=1 L=34
<  random
R=1 S=1 L=2

The first line is an empty line, and match returns seemingly random values.
The second should have a match, but not of length 34. The third is correct.

This is Gnu Awk 3.1.5 on Ubuntu 7.04

-- Alain.







reply via email to

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