This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: strings: \t special but \n not?
- From: Erik Ackermann <kurterikackermann at gmail dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Wed, 18 Jun 2014 17:40:43 -0700
- Subject: Re: strings: \t special but \n not?
- Authentication-results: sourceware.org; auth=none
- References: <CAN5Z5QEhQNgivGQVWaKGLt-2nyAEQ+a40v+PhdE=Gk7spffaJw at mail dot gmail dot com>
Did some digging and appears the '\t' was special cased back in commit
6b3bf560900b549065d93d5d43a9b6af0e3a5e95
Can we just include all whitespace characters?
This would allow you pull out text with short lines (or even empty
liines) from binaries etc
On Wed, Jun 18, 2014 at 5:17 PM, Erik Ackermann
<kurterikackermann@gmail.com> wrote:
> I have noticed that \n is treated differently than \t. Consider
>
> echo -e "HELLO\nW" | strings
> echo -e "HELLO\tW" | strings
>
> The first will print "HELLO" and the second "HELLO\tW"
>
> I have noticed in the code that in addition to checking ISPRINT(c), c
> == '\t' is also special cased as being a "string". Why is \t special
> and not other whitespace?
>
> Thanks,
> Erik