cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/lib ChangeLog getpass.c printf-args.c temp...


From: Mark D. Baushke
Subject: [Cvs-cvs] ccvs/lib ChangeLog getpass.c printf-args.c temp...
Date: Sun, 04 Jun 2006 09:25:48 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Mark D. Baushke <mdb>   06/06/04 09:25:48

Modified files:
        lib            : ChangeLog getpass.c printf-args.c tempname.c 

Log message:
        * getpass.c, printf-args.c, tempname.c: Update from gnulib.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/ChangeLog?cvsroot=cvs&r1=1.509&r2=1.510
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/getpass.c?cvsroot=cvs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/printf-args.c?cvsroot=cvs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/tempname.c?cvsroot=cvs&r1=1.8&r2=1.9

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/ChangeLog,v
retrieving revision 1.509
retrieving revision 1.510
diff -u -b -r1.509 -r1.510
--- ChangeLog   22 May 2006 23:58:59 -0000      1.509
+++ ChangeLog   4 Jun 2006 09:25:48 -0000       1.510
@@ -1,3 +1,7 @@
+2006-06-04  Mark D. Baushke  <address@hidden>
+
+       * getpass.c, printf-args.c, tempname.c: Update from gnulib.
+
 2006-05-22  Mark D. Baushke  <address@hidden>
 
        * nanosleep.c: Update from gnulib.

Index: getpass.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/getpass.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- getpass.c   19 Sep 2005 21:26:13 -0000      1.11
+++ getpass.c   4 Jun 2006 09:25:48 -0000       1.12
@@ -23,7 +23,7 @@
 
 #include <stdio.h>
 
-#if !defined _WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
 
 #include <stdbool.h>
 
@@ -170,13 +170,17 @@
   return buf;
 }
 
-#else /* WIN32 */
+#else /* W32 native */
 
 /* Windows implementation by Martin Lambers <address@hidden>,
    improved by Simon Josefsson. */
 
 /* For PASS_MAX. */
 #include <limits.h>
+/* For _getch(). */
+#include <conio.h>
+/* For strdup(). */
+#include <string.h>
 
 #ifndef PASS_MAX
 # define PASS_MAX 512

Index: printf-args.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/printf-args.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- printf-args.c       23 May 2005 17:44:32 -0000      1.2
+++ printf-args.c       4 Jun 2006 09:25:48 -0000       1.3
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -84,10 +84,29 @@
 #endif
       case TYPE_STRING:
        ap->a.a_string = va_arg (args, const char *);
+       /* A null pointer is an invalid argument for "%s", but in practice
+          it occurs quite frequently in printf statements that produce
+          debug output.  Use a fallback in this case.  */
+       if (ap->a.a_string == NULL)
+         ap->a.a_string = "(NULL)";
        break;
 #ifdef HAVE_WCHAR_T
       case TYPE_WIDE_STRING:
        ap->a.a_wide_string = va_arg (args, const wchar_t *);
+       /* A null pointer is an invalid argument for "%ls", but in practice
+          it occurs quite frequently in printf statements that produce
+          debug output.  Use a fallback in this case.  */
+       if (ap->a.a_wide_string == NULL)
+         {
+           static const wchar_t wide_null_string[] =
+             {
+               (wchar_t)'(',
+               (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
+               (wchar_t)')',
+               (wchar_t)0
+             };
+           ap->a.a_wide_string = wide_null_string;
+         }
        break;
 #endif
       case TYPE_POINTER:

Index: tempname.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/tempname.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- tempname.c  4 Oct 2005 02:34:54 -0000       1.8
+++ tempname.c  4 Jun 2006 09:25:48 -0000       1.9
@@ -1,7 +1,7 @@
 /* tempname.c - generate the name of a temporary file.
 
    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -66,14 +66,16 @@
 
 #if _LIBC
 # define struct_stat64 struct stat64
+# define small_open __open
+# define large_open __open64
 #else
 # include "stat-macros.h"
 # define struct_stat64 struct stat
+# define small_open open
+# define large_open open
 # define __getpid getpid
 # define __gettimeofday gettimeofday
 # define __mkdir mkdir
-# define __open open
-# define __open64 open
 # define __lxstat64(version, file, buf) lstat (file, buf)
 # define __xstat64(version, file, buf) stat (file, buf)
 #endif
@@ -269,11 +271,11 @@
       switch (kind)
        {
        case __GT_FILE:
-         fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+         fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
          break;
 
        case __GT_BIGFILE:
-         fd = __open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+         fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
          break;
 
        case __GT_DIR:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]