From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Fri, 17 Aug 2012 19:33:36 -0400 Subject: [U-Boot] [PATCH 3/3] hush: Include file and line number when reporting syntax errors In-Reply-To: <1345235191-13757-3-git-send-email-joe.hershberger@ni.com> References: <1345235191-13757-1-git-send-email-joe.hershberger@ni.com> <1345235191-13757-3-git-send-email-joe.hershberger@ni.com> Message-ID: <201208171933.37564.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 17 August 2012 16:26:31 Joe Hershberger wrote: > Make debugging script problems easier just like non-u-boot. err, but you're posting "hush.c" all the time, and the line number of the source code in hush.c, not the line of the shell script > --- a/common/hush.c > +++ b/common/hush.c > > #ifdef __U_BOOT__ > -static void syntax_err(void) { > - printf("syntax error\n"); > +static void __syntax_err(char *file, int line) const char *file > +{ > + printf("syntax error %s:%d\n", file, line); > } > +#define syntax_err() __syntax_err(__FILE__, __LINE__) shouldn't this be behind a DEBUG define ? -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: