This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strings: \t special but \n not?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]