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 /wsutil | |
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 'wsutil')
-rw-r--r-- | wsutil/filesystem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 30644d4b25..5bb03bc3f4 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1883,9 +1883,9 @@ get_datafile_path(const char *filename) * directory (not in the source/data directory). * (Oh the things we do to keep the source directory pristine...) */ - return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_progfile_dir(), filename); + return g_build_filename(get_progfile_dir(), filename, (char *)NULL); } else { - return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_datafile_dir(), filename); + return g_build_filename(get_datafile_dir(), filename, (char *)NULL); } } |