From 8f3563b73ebf945c69a2a49d2094d3098f374d5e Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 30 Sep 2011 00:42:50 +0000 Subject: [PATCH] minor fix to set the location of the first address properly when it's erroneous --- qse/lib/sed/sed.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qse/lib/sed/sed.c b/qse/lib/sed/sed.c index 2b8b7ed1..22b882bd 100644 --- a/qse/lib/sed/sed.c +++ b/qse/lib/sed/sed.c @@ -1602,6 +1602,7 @@ int qse_sed_comp (qse_sed_t* sed, const qse_char_t* sptr, qse_size_t slen) { qse_cint_t c; qse_sed_cmd_t* cmd = QSE_NULL; + qse_sed_loc_t a1_loc; /* store the source code pointers */ sed->src.ptr = sptr; @@ -1655,6 +1656,7 @@ int qse_sed_comp (qse_sed_t* sed, const qse_char_t* sptr, qse_size_t slen) QSE_MEMSET (cmd, 0, QSE_SIZEOF(*cmd)); /* process the first address */ + a1_loc = sed->src.loc; if (get_address (sed, &cmd->a1, 0) == QSE_NULL) { cmd = QSE_NULL; @@ -1743,7 +1745,7 @@ int qse_sed_comp (qse_sed_t* sed, const qse_char_t* sptr, qse_size_t slen) } else { - SETERR0 (sed, QSE_SED_EA1MOI, &sed->src.loc); + SETERR0 (sed, QSE_SED_EA1MOI, &a1_loc); goto oops; } }