mawk 1.3.3-17ubuntu2 incorrectly handles "/" in "[ ]" expressions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mawk (Debian) |
Fix Released
|
Unknown
|
|||
mawk (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
Binary package hint: mawk
Description: Ubuntu 9.04
Release: 9.04
Package version: mawk 1.3.3-13ubuntu1
Whilst attempting to run a shell script to automate the build procedure for an embedded platform I came across a parsing error in the mawk installation on my Ubuntu 9.04 box. I followed this up with the script author, and then the mawk maintainer, and determined that:
(a). The behavior of mawk 1.3.3-13ubuntu1 is incorrect
(b). The incorrect behavior exhibited by mawk 1.3.3-13ubuntu1 is not exhibited by the upstream sources mawk-1.3.3-20090920 when built on my Ubuntu box
The error case can be demonstrated using this script fragment:
for interpretter in gawk mawk;
do
echo "Running with $interpretter..."
echo
echo "diecimila.
$interpretter -v FS== '{boardname=$2; gsub(/[
echo
done
When run using my system's mawk installation I get the following output:
Running with gawk...
ArduinoDiecimil
Running with mawk...
mawk: line 1: regular expression compile failed (bad class -- [], [^] or [)
[^a-zA-Z0-9_,.
mawk: line 1: syntax error at or near )
bash: echo: write error: Broken pipe
When run using the upstream mawk I get the following output:
Running with gawk...
ArduinoDiecimil
Running with ./mawk...
ArduinoDiecimil
For reference, I built the upstream mawk package as follows:
./compile && make
That is, I used whatever defaults the autoconf script picked for my system.
Changed in mawk (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in mawk (Debian): | |
status: | Unknown → New |
Changed in mawk (Debian): | |
status: | New → Confirmed |
Changed in mawk (Debian): | |
status: | Confirmed → Fix Released |
The problem is still in mawk of Ubuntu 10.10
I found a version of mawk, maintained by a new developer: invisible- island. net/mawk/
http://
New mawk changelog (debian patches included + new things): invisible- island. net/mawk/ CHANGES
http://
This version works as expected too:
for interpretter in gawk mawk ../mawk- 1.3.4-20100625/ mawk ; do name=Arduino Diecimila, Duemilanove, or Nano w/ATmega168" | $interpretter -v FS== '{boardname=$2; gsub(/[ ^a-zA-Z0- 9_,./() :-]/, "", boardname); print boardname }';
echo "Running with $interpretter...";
echo;
echo "diecimila.
echo;
done
------- ------- ------- ------- ------- ------- ------- ------- ----
Running with gawk...
ArduinoDiecimil a,Duemilanove, orNanow/ ATmega168
Running with mawk...
mawk: line 1: regular expression compile failed (bad class -- [], [^] or [)
[^a-zA-Z0-9_,.
mawk: line 1: syntax error at or near )
Running with ../mawk- 1.3.4-20100625/ mawk...
ArduinoDiecimil a,Duemilanove, orNanow/ ATmega168
------- ------- ------- ------- ------- ------- ------- ------- ----