summaryrefslogtreecommitdiff
path: root/wsutil/filesystem.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2014-08-01 15:26:18 -0400
committerEvan Huus <eapache@gmail.com>2014-08-02 01:00:08 +0000
commitedb7a9110536cb079e26dafcdb5c12b028be84d3 (patch)
tree52a5afaced187c4863a23f569ae920b6faf60bbb /wsutil/filesystem.c
parent6b11cd97f2153bb015ade6efd05929999de85457 (diff)
downloadwireshark-edb7a9110536cb079e26dafcdb5c12b028be84d3.tar.gz
Make the nameres test suite work out of tree by looking for the global hosts
file in the build directory (rather than the source directory). Change-Id: I365e573ee84e9a41aa76f4aa9a4a6efaf42fb60e Reviewed-on: https://code.wireshark.org/review/3334 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'wsutil/filesystem.c')
-rw-r--r--wsutil/filesystem.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c
index 796251fec1..6125236bd7 100644
--- a/wsutil/filesystem.c
+++ b/wsutil/filesystem.c
@@ -1705,10 +1705,13 @@ get_persconffile_path(const char *filename, gboolean from_profile)
char *
get_datafile_path(const char *filename)
{
- if (running_in_build_directory_flag && !strcmp(filename, "AUTHORS-SHORT")) {
+ if (running_in_build_directory_flag &&
+ (!strcmp(filename, "AUTHORS-SHORT") ||
+ !strcmp(filename, "hosts"))) {
/* We're running in the build directory and the requested file is a
- * generated file. Return the file name in the build directory (not
- * in the source/data directory).
+ * generated (or a test) file. Return the file name in the build
+ * 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);
} else {