diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-04-26 17:36:58 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-04-30 10:33:46 +0000 |
commit | b9f915eeefc4e2db1f151cd5bd2f808711532b1c (patch) | |
tree | 484b22dec9e3013d2ecf3db0ffc336598888cc70 /epan/wslua/template-init.lua | |
parent | d8ba341856fcc2305e876a9f67430ca63d03ad01 (diff) |
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>
Diffstat (limited to 'epan/wslua/template-init.lua')
-rw-r--r-- | epan/wslua/template-init.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/wslua/template-init.lua b/epan/wslua/template-init.lua index d4c6c154fa..96888f83eb 100644 --- a/epan/wslua/template-init.lua +++ b/epan/wslua/template-init.lua @@ -128,9 +128,10 @@ end %MENU_GROUPS% -- other useful constants +-- DATA_DIR and USER_DIR have a trailing directory separator. GUI_ENABLED = gui_enabled() -DATA_DIR = Dir.global_config_path() -USER_DIR = Dir.personal_config_path() +DATA_DIR = Dir.global_config_path()..package.config:sub(1,1) +USER_DIR = Dir.personal_config_path()..package.config:sub(1,1) -- deprecated function names datafile_path = Dir.global_config_path |