From cce8ebd30680947dbf52051752c03d0e0d7cdb44 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 18 Dec 2000 11:41:41 -0200 Subject: [PATCH] obsolete `format' option (d$). --- lstrlib.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lstrlib.c b/lstrlib.c index 3eba827d..5db499dd 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.58 2000/11/24 17:39:56 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.59 2000/12/04 14:43:06 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -585,10 +585,8 @@ static int str_format (lua_State *L) { char form[MAX_FORMAT]; /* to store the format (`%...') */ char buff[MAX_ITEM]; /* to store the formatted item */ int hasprecision = 0; - if (isdigit((unsigned char)*strfrmt) && *(strfrmt+1) == '$') { - arg = *strfrmt - '0'; - strfrmt += 2; /* skip the `n$' */ - } + if (isdigit((unsigned char)*strfrmt) && *(strfrmt+1) == '$') + lua_error(L, "obsolete `format' option (d$)"); arg++; strfrmt = scanformat(L, strfrmt, form, &hasprecision); switch (*strfrmt++) {