Re: [PATCH] Shell utilities: Guard against expr' magic tokens.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 13, 2006, 23:39 UTC
- Message-ID
- <7vodz5vyd6.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <slrne3tihk.1dq.mdw@metalzone.distorted.org.uk>
Mark Wooding <mdw@distorted.org.uk> writes:
Show 5 quoted lines
> From: Mark Wooding <mdw@distorted.org.uk> > > Some words, e.g., `match', are special to expr(1), and cause strange > parsing effects. Track down all uses of expr and mangle the arguments > so that this isn't a problem.
Gaaaaaaaaaah.
http://www.opengroup.org/onlinepubs/009695399/utilities/expr.html
says use of length, substr, index, match as string arguments produces unspecified results, so obviously the program was wrong.
Thanks.