comparison src/fileio.c @ 195:a2f645c6b9f8 r20-3b24

Import from CVS: tag r20-3b24
author cvs
date Mon, 13 Aug 2007 09:59:05 +0200
parents 489f57a838ef
children 41ff10fd062f
comparison
equal deleted inserted replaced
194:2947057885e5 195:a2f645c6b9f8
1158 o = (Bufbyte *) alloca (p - nm + 1); 1158 o = (Bufbyte *) alloca (p - nm + 1);
1159 memcpy (o, (char *) nm, p - nm); 1159 memcpy (o, (char *) nm, p - nm);
1160 o [p - nm] = 0; 1160 o [p - nm] = 0;
1161 1161
1162 #ifdef WINDOWSNT 1162 #ifdef WINDOWSNT
1163 /*
1164 ** Now if the file given is "~foo/file" and HOME="c:/", then we
1165 ** want the file to be named "c:/file" ("~foo" becomes "c:/").
1166 ** The variable o has "~foo", so we can use the length of
1167 ** that string to offset nm. August Hill, 31 Aug 1998.
1168 */
1163 newdir = (unsigned char *) egetenv ("HOME"); 1169 newdir = (unsigned char *) egetenv ("HOME");
1164 dostounix_filename (newdir); 1170 dostounix_filename (newdir);
1171 nm += strlen(o) + 1;
1165 #else /* not WINDOWSNT */ 1172 #else /* not WINDOWSNT */
1166 /* Jamie reports that getpwnam() can get wedged by SIGIO/SIGALARM 1173 /* Jamie reports that getpwnam() can get wedged by SIGIO/SIGALARM
1167 occurring in it. (It can call select()). */ 1174 occurring in it. (It can call select()). */
1168 slow_down_interrupts (); 1175 slow_down_interrupts ();
1169 pw = (struct passwd *) getpwnam ((char *) o + 1); 1176 pw = (struct passwd *) getpwnam ((char *) o + 1);