Date: Fri, 16 Apr 2010 07:30:05 GMT From: Garrett Cooper <yanegomi@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/145748: hexdump(1) %s format qualifier broken Message-ID: <201004160730.o3G7U50G035474@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/145748; it has been noted by GNATS. From: Garrett Cooper <yanegomi@gmail.com> To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org Cc: Subject: Re: bin/145748: hexdump(1) %s format qualifier broken Date: Fri, 16 Apr 2010 00:25:16 -0700 This works however: echo "$(jot -b a 1024)" | hexdump -e '/1 "%4s\n"' The FSM is skipping over the format qualifier for %s in size() according to some basic poking via gdb, because of trailing characters after the qualifier: (gdb) set args -e '"%4s\n"' foo (gdb) r Starting program: /usr/src/usr.bin/hexdump/hexdump -e '"%4s\n"' foo Breakpoint 2, size (fs=0x800c07040) at parse.c:174 174 while (index(spec + 1, *++fmt)); (gdb) n Breakpoint 2, size (fs=0x800c07040) at parse.c:174 174 while (index(spec + 1, *++fmt)); (gdb) n 175 if (*fmt == '.' && isdigit(*++fmt)) { (gdb) p fmt $1 = (unsigned char *) 0x800c09062 "s\n" So the format strings with the qualifier itself aren't being properly divvied up, which is a more difficult state to deal with than I originally anticipated I'd be dealing with >:(... This comes back to the code mess in add() I have to deal with in several other PRs. Thanks, -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004160730.o3G7U50G035474>