X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Feditfns.c;h=ce1f101d97450dc2a5d4cebd6f9281b180885a1d;hb=51a1ea1f505fd48ac9f14b25e85208f5dfa6ff65;hp=9bb9b8e5ab1e49d5f433184ada4a02086207409a;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git diff --git a/src/editfns.c b/src/editfns.c index 9bb9b8e..ce1f101 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -821,6 +821,7 @@ uncache_home_directory (void) of a few bytes */ } +/* Returns the home directory, in external format */ char * get_home_directory (void) { @@ -878,16 +879,16 @@ get_home_directory (void) } 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 @@ Return the user's home directory, as a string. */ ()) { - 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, /*