Re: A bug in sed 4.1 backports ?
On Mon, Jun 28, 2004 at 11:35:21AM +0700, Rahmat M. Samik-Ibrahim wrote:
> After updating sed 4.1 (backports); strange errors occurs when running
> jigdo. Is that just me? Or is there problem with sed 4.1?
It's sed 4.1, Debian unstable has the same problem. Use the patch below,
from the Debian 0.7.1-3 package.
The problem appears to be that if '[' needs to be matched in a list of
characters inside a regexp, then [x[] will not work to match both 'x' and
'['. Instead, it needs to be [[x], i.e. the '[' must come first.
Cheers,
Richard
--
__ _
|_) /| Richard Atterer | GnuPG key:
| \/¯| http://atterer.net | 0x888354F7
¯ '` ¯
--- jigdo-0.7.1.orig/scripts/jigdo-lite
+++ jigdo-0.7.1/scripts/jigdo-lite
@@ -121,12 +121,12 @@
while $readLine l <&3; do
case "$l" in
"["*"]"*) break;;
- Filename=*) image="`echo $l | sed -e 's/^Filename= *//; s%['\\''\"$\\\`|&/[]%%g'`";;
- Template=*) templateURI="`echo $l | sed -e 's/^Template= *//; s%['\\''\"$\\\`|&[]%%g'`";;
- Template-MD5Sum=*) templateMD5="`echo $l | sed -e 's/^Template-MD5Sum= *//; s%['\\''\"$\\\`|&/[]%%g'`";;
+ Filename=*) image="`echo $l | sed -e 's/^Filename= *//; s%[['\\''\"$\\\`|&/]%%g'`";;
+ Template=*) templateURI="`echo $l | sed -e 's/^Template= *//; s%[['\\''\"$\\\`|&]%%g'`";;
+ Template-MD5Sum=*) templateMD5="`echo $l | sed -e 's/^Template-MD5Sum= *//; s%[['\\''\"$\\\`|&/]%%g'`";;
Template-MD5Sum=*) templateMD5="`echo $l | sed -e 's/^Template-MD5Sum= *//; s%[^a-zA-Z0-9_-]%%g'`";;
- ShortInfo=*) shortInfo="`echo $l | sed -e 's/^ShortInfo= *//; s%[$\\\`|[]%%g'`";;
- Info=*) info="`echo $l | sed -e 's/^Info= *//; s%['\\''\"$\\\`|[]%%g'`";;
+ ShortInfo=*) shortInfo="`echo $l | sed -e 's/^ShortInfo= *//; s%[[$\\\`|]%%g'`";;
+ Info=*) info="`echo $l | sed -e 's/^Info= *//; s%[['\\''\"$\\\`|]%%g'`";;
esac
done
# Image section read, check for validity
Reply to: