1 /* shell.c -- tilde utility functions that are normally provided by
2 bash when readline is linked as part of the shell. */
4 /* Copyright (C) 1998-2009 Free Software Foundation, Inc.
6 This file is part of the GNU Tilde Library.
8 The GNU Tilde Library is free software: you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as published
10 by the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 The GNU Tilde Library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with the GNU Tilde Library. If not, see <http://www.gnu.org/licenses/>.
22 #if defined (HAVE_CONFIG_H)
26 #if defined (HAVE_UNISTD_H)
28 # include <sys/types.h>
31 #endif /* HAVE_UNISTD_H */
33 #if defined (HAVE_STDLIB_H)
36 # include "ansi_stdlib.h"
37 #endif /* HAVE_STDLIB_H */
39 #if defined (HAVE_STRING_H)
43 #endif /* !HAVE_STRING_H */
47 #if !defined (HAVE_GETPW_DECLS)
48 extern struct passwd *getpwuid ();
49 #endif /* !HAVE_GETPW_DECLS */
52 get_env_value (varname)
55 return ((char *)getenv (varname));
64 home_dir = (char *)NULL;
65 entry = getpwuid (getuid ());
67 home_dir = entry->pw_dir;