X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Feditfns.c;h=a4ee7464eb1d8063689ebfb9a414772ae961a078;hb=3aca7317dd930beecbddba646284279744087e69;hp=306315efde2e006b6e97ff1d3d7a471b1fa2ece6;hpb=3e447015251ce6dcde843cbed10d9033d5538622;p=chise%2Fxemacs-chise.git- diff --git a/src/editfns.c b/src/editfns.c index 306315e..a4ee746 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -779,10 +779,10 @@ value of `user-full-name' is returned. /* #### - Stig sez: this should return nil instead of "unknown" when pw==0 */ /* Ben sez: bad idea because it's likely to break something */ #ifndef AMPERSAND_FULL_NAME - p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = pw ? USER_FULL_NAME : "unknown"; /* don't gettext */ q = strchr (p, ','); #else - p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = pw ? USER_FULL_NAME : "unknown"; /* don't gettext */ q = strchr (p, ','); #endif tem = ((!NILP (user) && !pw) @@ -822,10 +822,18 @@ uncache_home_directory (void) of a few bytes */ } +/* !!#### not Mule correct. */ + /* Returns the home directory, in external format */ Extbyte * get_home_directory (void) { + /* !!#### this is hopelessly bogus. Rule #1: Do not make any assumptions + about what format an external string is in. Could be Unicode, for all + we know, and then all the operations below are totally bogus. + Instead, convert all data to internal format *right* at the juncture + between XEmacs and the outside world, the very moment we first get + the data. --ben */ int output_home_warning = 0; if (cached_home_directory == NULL) @@ -847,7 +855,9 @@ get_home_directory (void) } else { -# if 1 +# if 0 /* changed by ben. This behavior absolutely stinks, and the + possibility being addressed here occurs quite commonly. + Using the current directory makes absolutely no sense. */ /* * Use the current directory. * This preserves the existing XEmacs behavior, but is different @@ -855,12 +865,12 @@ get_home_directory (void) */ if (initial_directory[0] != '\0') { - cached_home_directory = initial_directory; + cached_home_directory = (Extbyte*) initial_directory; } else { /* This will probably give the wrong value */ - cached_home_directory = getcwd (NULL, 0); + cached_home_directory = (Extbyte*) getcwd (NULL, 0); } # else /*