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>
This commit is contained in:
Jeff Morriss 2014-08-01 15:26:18 -04:00 committed by Evan Huus
parent 6b11cd97f2
commit edb7a91105
1 changed files with 6 additions and 3 deletions

View File

@ -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 {