Re: [PATCH v2] builtin: Fix handling of trailing IFS white spaces

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

 



On 06/06/16 10:48, Herbert Xu wrote:
On Fri, Dec 04, 2015 at 08:51:19PM +0100, Harald van Dijk wrote:

Here it is. Attached is an updated patch that ignores the complete
terminator if only a single field remains, otherwise ignores only
trailing IFS whitespace.

There is a little bug in the patch if you happened to start with
an escaped IFS, otherwise I think it's good.

Thanks. If starting with an escaped IFS, the CTLESC should already have been skipped before the if (maxargs == 1) check gets executed. That's done at the start of the outer loop, but is not visible in the patch because it's unmodified from the original code. Or did I misunderstand you here?

However, I think this loop is getting too deep so I've reworked
it to have just one loop over the string instead of three (two
nested loops).

Please test this.

With the link sent by Martijn Dekker earlier in this thread:


<http://web.archive.org/web/20050414022354/http://www.research.att.com/~gsf/public/ifs.sh>

it gives a lot of failures:

# tests 6856 passed 1844 failed 5012

I'll look into it in more detail later, if no one beats me to it.

Cheers,
Harald van Dijk
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux