Author: korli Date: 2009-11-14 12:51:33 +0100 (Sat, 14 Nov 2009) New Revision: 34027 Changeset: http://dev.haiku-os.org/changeset/34027/haiku Modified: haiku/trunk/src/bin/bash/bashline.c Log: uses B_COMMON_SETTINGS_DIRECTORY/network/hosts Modified: haiku/trunk/src/bin/bash/bashline.c =================================================================== --- haiku/trunk/src/bin/bash/bashline.c 2009-11-14 08:44:57 UTC (rev 34026) +++ haiku/trunk/src/bin/bash/bashline.c 2009-11-14 11:51:33 UTC (rev 34027) @@ -68,6 +68,10 @@ # include "pcomplete.h" #endif +#ifdef __HAIKU__ +#include <FindDirectory.h> +#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 @@ 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;