From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 16 07:30:06 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 378541065670 for ; Fri, 16 Apr 2010 07:30:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 27E968FC20 for ; Fri, 16 Apr 2010 07:30:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3G7U51l035482 for ; Fri, 16 Apr 2010 07:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o3G7U50G035474; Fri, 16 Apr 2010 07:30:05 GMT (envelope-from gnats) Date: Fri, 16 Apr 2010 07:30:05 GMT Message-Id: <201004160730.o3G7U50G035474@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Garrett Cooper Cc: Subject: Re: bin/145748: hexdump(1) %s format qualifier broken X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Cooper List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 07:30:06 -0000 The following reply was made to PR bin/145748; it has been noted by GNATS. From: Garrett Cooper 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