From b2b7e600a2d50d2c4d224e60b8487fb6149f969d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 14 Nov 2009 11:51:33 +0000 Subject: [PATCH] uses B_COMMON_SETTINGS_DIRECTORY/network/hosts git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34027 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/bash/bashline.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bin/bash/bashline.c b/src/bin/bash/bashline.c index c5e8369730..1b7e30e942 100644 --- a/src/bin/bash/bashline.c +++ b/src/bin/bash/bashline.c @@ -68,6 +68,10 @@ # include "pcomplete.h" #endif +#ifdef __HAIKU__ +#include +#endif + /* These should agree with the defines for emacs_mode and vi_mode in rldefs.h, even though that's not a public readline header file. */ #ifndef EMACS_EDITING_MODE @@ -634,10 +638,16 @@ static void initialize_hostname_list () { char *temp; + char path[PATH_MAX]; temp = get_string_value ("HOSTFILE"); if (temp == 0) temp = get_string_value ("hostname_completion_file"); + if (temp == 0 && find_directory(B_COMMON_SETTINGS_DIRECTORY, -1, false, path, + sizeof(path)) == B_OK) { + strlcat(path, "/network/hosts", sizeof(path)); + temp = path; + } if (temp == 0) temp = DEFAULT_HOSTS_FILE;