Lua: ensure that DATA_DIR and USER_DIR have trailing slashes
authorPeter Wu <peter@lekensteyn.nl>
Thu, 26 Apr 2018 15:36:58 +0000 (17:36 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Mon, 30 Apr 2018 10:33:46 +0000 (10:33 +0000)
commitb9f915eeefc4e2db1f151cd5bd2f808711532b1c
tree484b22dec9e3013d2ecf3db0ffc336598888cc70
parentd8ba341856fcc2305e876a9f67430ca63d03ad01
Lua: ensure that DATA_DIR and USER_DIR have trailing slashes

These directories have had trailing slashes for years and users seem to
rely on it, so restore this assumption for backwards compatibility. The
underlying API function (Dir.persconffile_path()) is not changed because
trailing slashes were not documented for that function.

For consistency, ensure that all Lua Dir functions return paths without
trailing slashes.

Bug: 14619
Change-Id: Ia299864999578884b1ad1cd48f1bd883bce6879d
Fixes: v2.5.0rc0-579-gfb052a637f ("Use g_build_filename() instead, fix indentation")
Reviewed-on: https://code.wireshark.org/review/27166
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
epan/wslua/template-init.lua
epan/wslua/wslua_dir.c
test/lua/dir.lua
wsutil/filesystem.c