lua-struct icon indicating copy to clipboard operation
lua-struct copied to clipboard

Enhancement: make `unpack` return where it stopped reading

Open EnTerr opened this issue 10 years ago • 0 comments

The code i am trying to port and uses struct needs this feature of Ierusalimschy's struct.unpack:

... After the read values, this function also returns the index in s where it stopped reading, which is also where you should start to read the rest of the string.

So i added it to my copy of lua-struct, as easy as adding a line at the end:

  table.insert(vars, iterator)   --<-- one line

  return unpack(vars)

EnTerr avatar Aug 21 '15 21:08 EnTerr