]> sjero.net Git - wget/blobdiff - src/safe-ctype.h
[svn] Merge of fix for bugs 20341 and 20410.
[wget] / src / safe-ctype.h
index 72413f78287c49bf234192fdc1d517c3f99e70cf..fa4f4d5cf55dcac3eff103437a525e9bd245597d 100644 (file)
@@ -7,7 +7,7 @@ This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
 modify it under the terms of the GNU Library General Public
 License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
+version 3 of the License, or (at your option) any later version.
 
 Libiberty is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,9 +15,18 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Library General Public License for more details.
 
 You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+License along with libiberty.  If not, see
+<http://www.gnu.org/licenses/>.
+
+In addition, as a special exception, the Free Software Foundation
+gives permission to link the code of its release of Wget with the
+OpenSSL project's "OpenSSL" library (or with modified versions of it
+that use the same license as the "OpenSSL" library), and distribute
+the linked executables.  You must obey the GNU General Public License
+in all respects for all of the code used other than "OpenSSL".  If you
+modify this file, you may extend this exception to your version of the
+file, but you are not obligated to do so.  If you do not wish to do
+so, delete this exception statement from your version.  */
 
 /* This is a compatible replacement of the standard C library's <ctype.h>
    with the following properties:
@@ -41,30 +50,22 @@ Boston, MA 02111-1307, USA.  */
 
 #ifndef I_REALLY_WANT_CTYPE_MACROS
 
+/* We used to #define these to errors, but that loses when real
+   ctype.h is included, usually by a library's (OpenSSL's) header
+   which gets #included after wget.h.  */
+
 #undef isalpha
-#define isalpha *** Please use ISALPHA ***
 #undef isalnum
-#define isalnum *** Please use ISALNUM ***
 #undef isblank
-#define isblank *** Please use ISBLANK ***
 #undef iscntrl
-#define iscntrl *** Please use ISCNTRL ***
 #undef isdigit
-#define isdigit *** Please use ISDIGIT ***
 #undef isgraph
-#define isgraph *** Please use ISGRAPH ***
 #undef islower
-#define islower *** Please use ISLOWER ***
 #undef isprint
-#define isprint *** Please use ISPRINT ***
 #undef ispunct
-#define ispunct *** Please use ISPUNCT ***
 #undef isspace
-#define isspace *** Please use ISSPACE ***
 #undef isupper
-#define isupper *** Please use ISUPPER ***
 #undef isxdigit
-#define isxdigit *** Please use ISXDIGIT ***
 
 #endif /* I_REALLY_WANT_CTYPE_MACROS */
 
@@ -98,7 +99,7 @@ enum {
 /* Character classification.  */
 extern const unsigned short _sch_istable[256];
 
-#define _sch_test(c, bit) (_sch_istable[(c) & 0xff] & (bit))
+#define _sch_test(c, bit) (_sch_istable[(c) & 0xff] & (unsigned short)(bit))
 
 #define ISALPHA(c)  _sch_test(c, _sch_isalpha)
 #define ISALNUM(c)  _sch_test(c, _sch_isalnum)