X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Faddext.c;h=fff64f7c7b7ba75f44fbbbb7fcab711517483fd2;hb=b3b353659ac863c94e9705047710a99fa58fe0b1;hp=571e3c2db4c643fe80f7c09e37fc6c1f28bee63f;hpb=a9000fb035c8b0166dca066396fff5a9857369fb;p=gnulib.git diff --git a/lib/addext.c b/lib/addext.c index 571e3c2db..fff64f7c7 100644 --- a/lib/addext.c +++ b/lib/addext.c @@ -1,5 +1,7 @@ /* addext.c -- add an extension to a file name - Copyright 1990, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. + + Copyright (C) 1990, 1997, 1998, 1999, 2001, 2003 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 @@ -29,19 +31,13 @@ # define HAVE_LONG_FILE_NAMES 0 #endif -#if HAVE_LIMITS_H -# include -#endif +#include #ifndef _POSIX_NAME_MAX # define _POSIX_NAME_MAX 14 #endif -#include -#if HAVE_STRING_H -# include -#else -# include -#endif +#include +#include #if HAVE_UNISTD_H # include @@ -83,7 +79,11 @@ addext (char *filename, char const *ext, int e) *s = c; } if (0 <= name_max || errno == 0) - slen_max = name_max == (size_t) name_max ? name_max : -1; + { + long size = slen_max = name_max; + if (name_max != size) + slen_max = -1; + } } #endif