From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5848 invoked from network); 25 Nov 1999 19:03:37 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Nov 1999 19:03:37 -0000 Received: (qmail 27769 invoked by alias); 25 Nov 1999 19:03:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8782 Received: (qmail 27761 invoked from network); 25 Nov 1999 19:03:05 -0000 From: "Bart Schaefer" Message-Id: <991125190258.ZM7311@candle.brasslantern.com> Date: Thu, 25 Nov 1999 19:02:58 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: PATCH: 3.1.6-pws-9: Line numbers wrong on "unmatched" errors MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii The ideal thing here would be to print the error message *AFTER* the hungetc(c); at the "brk:" label, but that requires too much rewriting. Index: Src/lex.c =================================================================== @@ -1119,7 +1119,9 @@ } ALLOWHIST if (c != '\'') { + lineno -= (c == '\n'); zerr("unmatched \'", NULL, 0); + lineno += (c == '\n'); peek = LEXERR; cmdpop(); goto brk; @@ -1141,7 +1143,9 @@ c = dquote_parse('"', sub); cmdpop(); if (c) { + lineno -= (c == '\n'); zerr("unmatched \"", NULL, 0); + lineno += (c == '\n'); peek = LEXERR; goto brk; } @@ -1178,7 +1182,9 @@ ALLOWHIST cmdpop(); if (c != '`') { + lineno -= (c == '\n'); zerr("unmatched `", NULL, 0); + lineno += (c == '\n'); peek = LEXERR; goto brk; } -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com