From 78146a8f9137bf60ca645949b0e967e905ccd087 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 23 May 2009 19:47:43 +0000 Subject: [PATCH] enhanced error handling --- qse/lib/sed/sed.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qse/lib/sed/sed.c b/qse/lib/sed/sed.c index e5328e13..5f59f5ad 100644 --- a/qse/lib/sed/sed.c +++ b/qse/lib/sed/sed.c @@ -988,6 +988,9 @@ restart: case QSE_CHAR_EOF: SETERR0 (sed, QSE_SED_ECMDMS, sed->src.lnum); return -1; + case QSE_T('\n'): + SETERR0 (sed, QSE_SED_ECMDMS, sed->src.lnum-1); + return -1; case QSE_T(':'): /* label - this is not a command */ @@ -995,7 +998,10 @@ restart: if (cmd->a1.type != QSE_SED_ADR_NONE) { /* label cannot have an address */ - SETERR1 (sed, QSE_SED_EA1PHB, 0, &cmd->type, 1); + SETERR1 ( + sed, QSE_SED_EA1PHB, sed->src.lnum, + &cmd->type, 1 + ); return -1; }