comparison src/fileio.c @ 294:4b85ae5eabfb r21-0b45

Import from CVS: tag r21-0b45
author cvs
date Mon, 13 Aug 2007 10:38:01 +0200
parents c9fe270a4101
children 70ad99077275
comparison
equal deleted inserted replaced
293:403535bfea94 294:4b85ae5eabfb
787 #else 787 #else
788 struct passwd *pw; 788 struct passwd *pw;
789 #endif /* WINDOWSNT */ 789 #endif /* WINDOWSNT */
790 int length; 790 int length;
791 Lisp_Object handler; 791 Lisp_Object handler;
792 #ifdef __CYGWIN32__
793 char *user;
794 #endif
792 795
793 CHECK_STRING (name); 796 CHECK_STRING (name);
794 797
795 /* If the file name has special constructs in it, 798 /* If the file name has special constructs in it,
796 call the corresponding file handler. */ 799 call the corresponding file handler. */
1017 1998. */ 1020 1998. */
1018 newdir = (Bufbyte *) get_home_directory(); 1021 newdir = (Bufbyte *) get_home_directory();
1019 dostounix_filename (newdir); 1022 dostounix_filename (newdir);
1020 nm += strlen(o) + 1; 1023 nm += strlen(o) + 1;
1021 #else /* not WINDOWSNT */ 1024 #else /* not WINDOWSNT */
1025 #ifdef __CYGWIN32__
1026 if ((user = user_login_name (NULL)) != NULL)
1027 {
1028 /* Does the user login name match the ~name? */
1029 if (strcmp(user,((char *) o + 1)) == 0)
1030 {
1031 newdir = (Bufbyte *) get_home_directory();
1032 nm = p;
1033 }
1034 }
1035 if (! newdir)
1036 {
1037 #endif /* __CYGWIN32__ */
1022 /* Jamie reports that getpwnam() can get wedged by SIGIO/SIGALARM 1038 /* Jamie reports that getpwnam() can get wedged by SIGIO/SIGALARM
1023 occurring in it. (It can call select()). */ 1039 occurring in it. (It can call select()). */
1024 slow_down_interrupts (); 1040 slow_down_interrupts ();
1025 pw = (struct passwd *) getpwnam ((char *) o + 1); 1041 pw = (struct passwd *) getpwnam ((char *) o + 1);
1026 speed_up_interrupts (); 1042 speed_up_interrupts ();
1027 if (pw) 1043 if (pw)
1028 { 1044 {
1029 newdir = (Bufbyte *) pw -> pw_dir; 1045 newdir = (Bufbyte *) pw -> pw_dir;
1030 nm = p; 1046 nm = p;
1031 } 1047 }
1048 #ifdef __CYGWIN32__
1049 }
1050 #endif
1032 #endif /* not WINDOWSNT */ 1051 #endif /* not WINDOWSNT */
1033 1052
1034 /* If we don't find a user of that name, leave the name 1053 /* If we don't find a user of that name, leave the name
1035 unchanged; don't move nm forward to p. */ 1054 unchanged; don't move nm forward to p. */
1036 } 1055 }