On Fri, Jun 8, 2012 at 4:21 AM, Stefan Seyfried <stefan.seyfried@googlemail.com> wrote:
'/^Package:/{print "NAME=\""$2"\""}; /^Version:/{print "VERSION=\""$2"\""}' CONTROL/control)
'/^Package:/{printf("NAME=\"%s\"\n", $2);}; /^Version:/{printf("VERSION=\"%s\"\n", $2);}' CONTROL/control)
How does that help? $2 was empty. Guido explained this to me (in personal mail, as this topic is offtopic here), debian has an obsolet version of mawk which does not support character classed. The code is now using [\t ]* instead of [[:space:]*]
I don't know why David suggested so, but I can say, at least, that the first form is a security hole. You must NEVER send arbitrary strings as a format string to printf, as that's a quick path into buffer overflow exploits. The second form is safer, since the arbitrary strings aren't passed as format strings, but arguments. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org