Re: loadfile and line number
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: loadfile and line number
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2012年10月11日 09:21:04 -0300
> >Anyway, I'm curious: do you have file names with say ":2012: " in them?
>
> As I'm on Windows, the answer is "no". But in case of loadstring, there
> may be (user supplied) strings that could just begin with ":2012: ".
I was going to suggest that parsing the error message in reverse is robust:
message:reverse():match(" :(%d+):"):reverse()
but, no, the error message can contain that pattern:
print(loadstring'":2012: patt"')
So, I don't see a solution. Sorry about that.