User: ben
Date: 05/09/27 07:32:26
Modified: xemacs/src ChangeLog sysdep.c nt.c
Log:
[21.4] Fix bugs in nt.c, sysdep.c
sysdep.c: Fix bit-rotted dup2 code. Also new -> new_.
nt.c: Fix possible use of uninitialized var. Also new -> new_.
Revision Changes Path
1.861 +12 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.860
retrieving revision 1.861
diff -u -p -r1.860 -r1.861
--- ChangeLog 2005/09/27 05:29:41 1.860
+++ ChangeLog 2005/09/27 05:32:19 1.861
@@ -1,5 +1,17 @@
2005-09-27 Ben Wing <ben(a)xemacs.org>
+ * sysdep.c (emacs_set_tty):
+ * sysdep.c (qxe_link):
+ * sysdep.c (qxe_rename):
+ * sysdep.c (dup2):
+ Fix bit-rotted dup2 code. Also new -> new_.
+ * nt.c:
+ * nt.c (mswindows_closedir):
+ * nt.c (mswindows_link):
+ Fix possible use of uninitialized var. Also new -> new_.
+
+2005-09-27 Ben Wing <ben(a)xemacs.org>
+
* text.c (wcscmp_ascii):
* text.c (COPY_TEXT_BETWEEN_FORMATS):
* event-Xt.c (x_event_to_emacs_event):
1.83 +17 -17 XEmacs/xemacs/src/sysdep.c
Index: sysdep.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -p -r1.82 -r1.83
--- sysdep.c 2005/06/26 18:05:05 1.82
+++ sysdep.c 2005/09/27 05:32:21 1.83
@@ -1458,19 +1458,19 @@ emacs_set_tty (int fd, struct emacs_tty
}
else
{
- struct termios new;
+ struct termios new_;
/* Get the current settings, and see if they're what we asked for. */
- tcgetattr (fd, &new);
+ tcgetattr (fd, &new_);
/* We cannot use memcmp on the whole structure here because under
* aix386 the termios structure has some reserved field that may
* not be filled in.
*/
- if ( new.c_iflag == settings->main.c_iflag
- && new.c_oflag == settings->main.c_oflag
- && new.c_cflag == settings->main.c_cflag
- && new.c_lflag == settings->main.c_lflag
- && memcmp(new.c_cc, settings->main.c_cc, NCCS) == 0)
+ if ( new_.c_iflag == settings->main.c_iflag
+ && new_.c_oflag == settings->main.c_oflag
+ && new_.c_cflag == settings->main.c_cflag
+ && new_.c_lflag == settings->main.c_lflag
+ && memcmp(new_.c_cc, settings->main.c_cc, NCCS) == 0)
break;
else
continue;
@@ -3293,28 +3293,28 @@ qxe_chmod (const Ibyte *path, mode_t mod
#if defined (HAVE_LINK)
int
-qxe_link (const Ibyte *existing, const Ibyte *new)
+qxe_link (const Ibyte *existing, const Ibyte *new_)
{
#ifdef WIN32_NATIVE
- return mswindows_link (existing, new);
+ return mswindows_link (existing, new_);
#else /* not WIN32_NATIVE */
Extbyte *existingout, *newout;
PATHNAME_CONVERT_OUT (existing, existingout);
- PATHNAME_CONVERT_OUT (new, newout);
+ PATHNAME_CONVERT_OUT (new_, newout);
return link (existingout, newout);
#endif /* WIN32_NATIVE */
}
#endif /* defined (HAVE_LINK) */
int
-qxe_rename (const Ibyte *old, const Ibyte *new)
+qxe_rename (const Ibyte *old, const Ibyte *new_)
{
#ifdef WIN32_NATIVE
- return mswindows_rename (old, new);
+ return mswindows_rename (old, new_);
#else /* not WIN32_NATIVE */
Extbyte *oldout, *newout;
PATHNAME_CONVERT_OUT (old, oldout);
- PATHNAME_CONVERT_OUT (new, newout);
+ PATHNAME_CONVERT_OUT (new_, newout);
return rename (oldout, newout);
#endif /* WIN32_NATIVE */
}
@@ -3594,12 +3594,12 @@ dup2 (int oldd, int newd)
signal_ferror_with_frob (Qfile_error, lisp_strerror (errno),
"can't dup2 (%i, %i)", oldd, newd);
#else
- fd = dup (old);
+ fd = dup (oldd);
if (fd == -1)
return -1;
- if (fd == new)
- return new;
- ret = dup2 (old, new);
+ if (fd == newd)
+ return newd;
+ ret = dup2 (oldd, newd);
retry_close (fd);
return ret;
#endif /* F_DUPFD */
1.47 +5 -5 XEmacs/xemacs/src/nt.c
Index: nt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/nt.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -p -r1.46 -r1.47
--- nt.c 2005/01/28 02:36:25 1.46
+++ nt.c 2005/09/27 05:32:22 1.47
@@ -1,6 +1,6 @@
/* Utility and Unix shadow routines under MS Windows (WIN32_NATIVE defined).
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
- Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -834,7 +834,7 @@ mswindows_opendir (const Ibyte *filename
int
mswindows_closedir (DIR *dirp)
{
- int retval;
+ int retval = -1;
/* If we have a find-handle open, close it. */
if (dir_find_handle != INVALID_HANDLE_VALUE)
@@ -1081,13 +1081,13 @@ mswindows_access (const Ibyte *path, int
/* #### NT 5.0 has a function CreateHardLink to do this directly,
and it may do more things. */
int
-mswindows_link (const Ibyte *old, const Ibyte *new)
+mswindows_link (const Ibyte *old, const Ibyte *new_)
{
HANDLE fileh;
int result = -1;
Extbyte *oldext;
- if (old == NULL || new == NULL)
+ if (old == NULL || new_ == NULL)
{
errno = ENOENT;
return -1;
@@ -1114,7 +1114,7 @@ mswindows_link (const Ibyte *old, const
WCHAR wbuffer[_MAX_PATH]; /* extra space for link name */
} data;
- TO_EXTERNAL_FORMAT (C_STRING, new,
+ TO_EXTERNAL_FORMAT (C_STRING, new_,
ALLOCA, (newuni, wlen), Qmswindows_unicode);
if (wlen / sizeof (WCHAR) < _MAX_PATH)
{