Skip to content

the issue of path truncation in error strings #275

Description

@scriptkitz

eg.
Lua error:
[string ".../zzz/abc.py"]:48: attempt to call a nil value (global 'testf')

LuaRT error:
[string "E:/xxx/yyy/..."]:48: attempt to call a nil value (global 'testf')

In luaL_loadfilep(), when loading the preprocessed source buffer into the Lua VM (via luaL_loadbuffer or similar), the filename passed as the chunkname is missing the @ prefix. This causes Lua to treat the filename as a raw string chunk, resulting in the actual filename being truncated at the end of the path instead of truncating the directory prefix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions