Mercurial > hg > xemacs-beta
diff src/editfns.c @ 386:4af0ddfb7c5b r21-2-8
Import from CVS: tag r21-2-8
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:08:50 +0200 |
parents | 8626e4521993 |
children | 74fd4e045ea6 |
line wrap: on
line diff
--- a/src/editfns.c Mon Aug 13 11:08:25 2007 +0200 +++ b/src/editfns.c Mon Aug 13 11:08:50 2007 +0200 @@ -821,6 +821,7 @@ of a few bytes */ } +/* Returns the home directory, in external format */ char * get_home_directory (void) { @@ -878,16 +879,16 @@ } if (initialized && output_home_warning) { - warn_when_safe(Quser_files_and_directories, Qwarning, "\n" + warn_when_safe (Quser_files_and_directories, Qwarning, "\n" " XEmacs was unable to determine a good value for the user's $HOME\n" " directory, and will be using the value:\n" " %s\n" " This is probably incorrect.", - cached_home_directory - ); + cached_home_directory + ); } } - return (cached_home_directory); + return cached_home_directory; } DEFUN ("user-home-directory", Fuser_home_directory, 0, 0, 0, /* @@ -895,18 +896,12 @@ */ ()) { - Lisp_Object directory; - char *path; + char *path = get_home_directory (); - directory = Qnil; - path = get_home_directory (); - if (path != NULL) - { - directory = - Fexpand_file_name (Fsubstitute_in_file_name (build_string (path)), - Qnil); - } - return (directory); + return path == NULL ? Qnil : + Fexpand_file_name (Fsubstitute_in_file_name + (build_ext_string (path, FORMAT_FILENAME)), + Qnil); } DEFUN ("system-name", Fsystem_name, 0, 0, 0, /*