comparison src/nt.c @ 558:ed498ef2108b

[xemacs-hg @ 2001-05-23 09:59:33 by ben] xemacs.mak: call `ver' to get the exact os version and put it in the installation; suggestion from adrian. behavior-defs.el: Add scroll-in-place, jka-compr, efs, fix up some things. pop.c: Remove BROKEN_CYGWIN. etc\sample.init.el: Rewrite to be much more careful about loading features -- now it decays gracefully even in the complete absence of packages. Also avoid doing obnoxious things when loading efs. configure.in: add some support for eventually turning on file coding by default. Fix numerous places where AC_MSG_WARN had quotes around its arg, which is bad. Replace with []. Same for AC_MSG_ERROR. s\cygwin32.h, s\mingw32.h: remove support for way old beta versions of cygwin. don't put -Wno-sign-compare in the system switches; this isn't a system issue. define BROKEN_SIGIO for cygwin to get C-g support. device-msw.c: signal an error rather than crash with an unavailable network printer (from Mike Alexander). event-msw.c: cleanup headers. fix (hopefully) an error with data corruption when sending to a network connection. fileio.c: Fix evil code that attempts to handle the ~user prefix by (a) always assuming we're referencing ourselves and not even verifying the user -- hence any file with a tilde as its first char is invalid! (b) if there wasn't a slash following the filename, the pointer was set *past* the end of file and we started reading from uninitialized memory. Now we simply treat these as files, always. optionally for 21.4 (doc fix): lread.c: cambia de pas_de_lache_ici -- al minimo usa la palabra certa. frame.c: fix warnings. emacs.c, nt.c, ntproc.c, process-nt.c, realpath.c, unexnt.c: rename MAX_PATH to standard PATH_MAX. process-nt.c, realpath.c: cleanup headers. process-unix.c, sysdep.c, systime.h, syswindows.h: kill BROKEN_CYGWIN and support for way old beta versions of cygwin. sysfile.h: use _MAX_PATH (Windows) preferentially for PATH_MAX if defined. include io.h on Cygwin (we need get_osfhandle()). include sys/fcntl.h always, since we were including it in various header files anyway. unexcw.c: fix up style to conform to standard. remove duplicate definition of PERROR. buffer.c: comment change. database.c, debug.h, device-tty.c, dired-msw.c, glyphs-msw.c: header cleanups (remove places that directly include a system header file, because we have our own layer to do this more cleanly and portably); indentation fixes.
author ben
date Wed, 23 May 2001 09:59:48 +0000
parents 666d73d6ac56
children 190b164ddcac
comparison
equal deleted inserted replaced
557:f486da5f1a3b 558:ed498ef2108b
441 win32_get_long_filename (char * name, char * buf, int size) 441 win32_get_long_filename (char * name, char * buf, int size)
442 { 442 {
443 char * o = buf; 443 char * o = buf;
444 char * p; 444 char * p;
445 char * q; 445 char * q;
446 char full[ MAX_PATH ]; 446 char full[ PATH_MAX ];
447 int len; 447 int len;
448 448
449 len = strlen (name); 449 len = strlen (name);
450 if (len >= MAX_PATH) 450 if (len >= PATH_MAX)
451 return FALSE; 451 return FALSE;
452 452
453 /* Use local copy for destructive modification. */ 453 /* Use local copy for destructive modification. */
454 memcpy (full, name, len+1); 454 memcpy (full, name, len+1);
455 unixtodos_filename (full); 455 unixtodos_filename (full);
630 if (!GetCurrentDirectory (MAXPATHLEN, startup_dir)) 630 if (!GetCurrentDirectory (MAXPATHLEN, startup_dir))
631 abort (); 631 abort ();
632 632
633 { 633 {
634 char *p; 634 char *p;
635 char modname[MAX_PATH]; 635 char modname[PATH_MAX];
636 636
637 if (!GetModuleFileName (NULL, modname, MAX_PATH)) 637 if (!GetModuleFileName (NULL, modname, PATH_MAX))
638 abort (); 638 abort ();
639 if ((p = strrchr (modname, '\\')) == NULL) 639 if ((p = strrchr (modname, '\\')) == NULL)
640 abort (); 640 abort ();
641 *p = 0; 641 *p = 0;
642 642
768 cdrom drive, ~5-10ms or more for remote drives on LAN). */ 768 cdrom drive, ~5-10ms or more for remote drives on LAN). */
769 volume_info_data * 769 volume_info_data *
770 GetCachedVolumeInformation (char * root_dir) 770 GetCachedVolumeInformation (char * root_dir)
771 { 771 {
772 volume_info_data * info; 772 volume_info_data * info;
773 char default_root[ MAX_PATH ]; 773 char default_root[ PATH_MAX ];
774 774
775 /* NULL for root_dir means use root from current directory. */ 775 /* NULL for root_dir means use root from current directory. */
776 if (root_dir == NULL) 776 if (root_dir == NULL)
777 { 777 {
778 if (GetCurrentDirectory (MAX_PATH, default_root) == 0) 778 if (GetCurrentDirectory (PATH_MAX, default_root) == 0)
779 return NULL; 779 return NULL;
780 parse_root (default_root, &root_dir); 780 parse_root (default_root, &root_dir);
781 *root_dir = 0; 781 *root_dir = 0;
782 root_dir = default_root; 782 root_dir = default_root;
783 } 783 }
858 /* Get information on the volume where name is held; set path pointer to 858 /* Get information on the volume where name is held; set path pointer to
859 start of pathname in name (past UNC header\volume header if present). */ 859 start of pathname in name (past UNC header\volume header if present). */
860 int 860 int
861 get_volume_info (const char * name, const char ** pPath) 861 get_volume_info (const char * name, const char ** pPath)
862 { 862 {
863 char temp[MAX_PATH]; 863 char temp[PATH_MAX];
864 char *rootname = NULL; /* default to current volume */ 864 char *rootname = NULL; /* default to current volume */
865 volume_info_data * info; 865 volume_info_data * info;
866 866
867 if (name == NULL) 867 if (name == NULL)
868 return FALSE; 868 return FALSE;
918 918
919 /* Map filename to a legal 8.3 name if necessary. */ 919 /* Map filename to a legal 8.3 name if necessary. */
920 const char * 920 const char *
921 map_win32_filename (const char * name, const char ** pPath) 921 map_win32_filename (const char * name, const char ** pPath)
922 { 922 {
923 static char shortname[MAX_PATH]; 923 static char shortname[PATH_MAX];
924 char * str = shortname; 924 char * str = shortname;
925 char c; 925 char c;
926 const char * path; 926 const char * path;
927 const char * save_name = name; 927 const char * save_name = name;
928 928
1120 #if 0 1120 #if 0
1121 /* #### Have to check if all that sad story about '95 is true - kkm */ 1121 /* #### Have to check if all that sad story about '95 is true - kkm */
1122 int 1122 int
1123 sys_rename (const char * oldname, const char * newname) 1123 sys_rename (const char * oldname, const char * newname)
1124 { 1124 {
1125 char temp[MAX_PATH]; 1125 char temp[PATH_MAX];
1126 DWORD attr; 1126 DWORD attr;
1127 1127
1128 /* MoveFile on Win95 doesn't correctly change the short file name 1128 /* MoveFile on Win95 doesn't correctly change the short file name
1129 alias in a number of circumstances (it is not easy to predict when 1129 alias in a number of circumstances (it is not easy to predict when
1130 just by looking at oldname and newname, unfortunately). In these 1130 just by looking at oldname and newname, unfortunately). In these
1346 /* Return the hash value of the canonical pathname, excluding the 1346 /* Return the hash value of the canonical pathname, excluding the
1347 drive/UNC header, to get a hopefully unique inode number. */ 1347 drive/UNC header, to get a hopefully unique inode number. */
1348 static DWORD 1348 static DWORD
1349 generate_inode_val (const char * name) 1349 generate_inode_val (const char * name)
1350 { 1350 {
1351 char fullname[ MAX_PATH ]; 1351 char fullname[ PATH_MAX ];
1352 char * p; 1352 char * p;
1353 unsigned hash; 1353 unsigned hash;
1354 1354
1355 /* Get the truly canonical filename, if it exists. (Note: this 1355 /* Get the truly canonical filename, if it exists. (Note: this
1356 doesn't resolve aliasing due to subst commands, or recognize hard 1356 doesn't resolve aliasing due to subst commands, or recognize hard
1357 links. */ 1357 links. */
1358 if (!win32_get_long_filename ((char *)name, fullname, MAX_PATH)) 1358 if (!win32_get_long_filename ((char *)name, fullname, PATH_MAX))
1359 abort (); 1359 abort ();
1360 1360
1361 parse_root (fullname, &p); 1361 parse_root (fullname, &p);
1362 /* Normal Win32 filesystems are still case insensitive. */ 1362 /* Normal Win32 filesystems are still case insensitive. */
1363 _strlwr (p); 1363 _strlwr (p);