summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/lib
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-12-11 12:24:21 +0000
committerpeter <peter@FreeBSD.org>1999-12-11 12:24:21 +0000
commit784ea5066cbea73d04e8ce5783dd0eb842e3ac1f (patch)
tree2a59869a343a5d43c01370f1083d67c2a02785a0 /contrib/cvs/lib
parent308b60f66831aa65a459a7b347ea6ca14b6e4799 (diff)
downloadFreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.zip
FreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.tar.gz
Import cvs-1.10.7. There are a number of nasty bugs that have been fixed.
Obtained from: cyclic.com
Diffstat (limited to 'contrib/cvs/lib')
-rw-r--r--contrib/cvs/lib/ChangeLog42
-rw-r--r--contrib/cvs/lib/Makefile.in1
-rw-r--r--contrib/cvs/lib/fnmatch.c13
-rw-r--r--contrib/cvs/lib/getdate.y6
-rw-r--r--contrib/cvs/lib/getopt.h12
-rw-r--r--contrib/cvs/lib/md5.c55
-rw-r--r--contrib/cvs/lib/md5.h23
-rw-r--r--contrib/cvs/lib/memmove.c5
8 files changed, 96 insertions, 61 deletions
diff --git a/contrib/cvs/lib/ChangeLog b/contrib/cvs/lib/ChangeLog
index 264b7ac..37cc6ab 100644
--- a/contrib/cvs/lib/ChangeLog
+++ b/contrib/cvs/lib/ChangeLog
@@ -1,3 +1,45 @@
+1999-03-26 Jim Kingdon <http://www.cyclic.com>
+
+ * getopt.h: Don't declare the arguments to getopt.
+
+1999-02-09 Jim Kingdon <http://www.cyclic.com>
+
+ * vasprintf.c: Removed; there is apparently no clean, portable
+ solution to the VA_LIST_IS_ARRAY problem (C9X drafts have va_copy,
+ but we aren't even assuming C90 yet!).
+ * Makefile.in (SOURCES): Remove vasprintf.c.
+ * build_lib.com: Remove vasprintf.c and vasprintf.obj.
+
+1999-01-26 Jim Kingdon <http://www.cyclic.com>
+ and Joerg Bullmann <http://www.glink.net.hk/~jb/MacCVSClient/>
+
+ * fnmatch.c: Use FOLD_FN_CHAR in two cases where it had been
+ omitted.
+
+1999-01-22 Jim Kingdon <http://www.cyclic.com>
+
+ * fnmatch.c: Include system.h; FOLD_FN_CHAR has moved there from
+ config.h (from Alexey Milov). Don't define our own FOLD_FN_CHAR;
+ that just masks cases in which we got the includes tangled up.
+
+1999-01-12 Jim Kingdon <http://www.cyclic.com>
+
+ * memmove.c: Remove paragraph which contained the FSF's old
+ snail mail address; it has changed.
+
+1999-01-05 Jim Kingdon <http://www.cyclic.com>
+
+ * md5.c, md5.h: Rename all the external interfaces to start with
+ cvs_* to avoid namespace pollution problems. Include string.h
+ unconditionally, to avoid gcc -Wall warnings on memset.
+
+1998-12-29 Jim Kingdon <http://www.cyclic.com>
+
+ * getdate.y (RelativeMonth): Add 1900 to tm_year, so that in 2000,
+ we pass 2000, not 100, to Convert.
+ (Convert): Add comment about Year argument.
+ * getdate.c: Regenerated using byacc.
+
Tue Mar 24 16:08:00 1998 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (CFLAGS): Set to @CFLAGS@, not -g.
diff --git a/contrib/cvs/lib/Makefile.in b/contrib/cvs/lib/Makefile.in
index 99d816b..f35baae 100644
--- a/contrib/cvs/lib/Makefile.in
+++ b/contrib/cvs/lib/Makefile.in
@@ -46,7 +46,6 @@ SOURCES = \
stripslash.c \
strtoul.c \
valloc.c \
- vasprintf.c \
waitpid.c \
xgetwd.c \
yesno.c
diff --git a/contrib/cvs/lib/fnmatch.c b/contrib/cvs/lib/fnmatch.c
index cf0f124..a41c0dc 100644
--- a/contrib/cvs/lib/fnmatch.c
+++ b/contrib/cvs/lib/fnmatch.c
@@ -18,14 +18,7 @@ Library General Public License for more details. */
#include "config.h"
#endif
-/* Some file systems are case-insensitive. If FOLD_FN_CHAR is
- #defined, it maps the character C onto its "canonical" form. In a
- case-insensitive system, it would map all alphanumeric characters
- to lower case. Under Windows NT, / and \ are both path component
- separators, so FOLD_FN_CHAR would map them both to /. */
-#ifndef FOLD_FN_CHAR
-#define FOLD_FN_CHAR(c) (c)
-#endif
+#include "system.h"
/* IGNORE(@ */
/* #include <ansidecl.h> */
@@ -75,7 +68,7 @@ fnmatch (pattern, string, flags)
case '\\':
if (!(flags & FNM_NOESCAPE))
c = *p++;
- if (*n != c)
+ if (FOLD_FN_CHAR (*n) != FOLD_FN_CHAR (c))
return FNM_NOMATCH;
break;
@@ -95,7 +88,7 @@ fnmatch (pattern, string, flags)
{
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
for (--p; *n != '\0'; ++n)
- if ((c == '[' || *n == c1) &&
+ if ((c == '[' || FOLD_FN_CHAR (*n) == FOLD_FN_CHAR (c1)) &&
fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
return 0;
return FNM_NOMATCH;
diff --git a/contrib/cvs/lib/getdate.y b/contrib/cvs/lib/getdate.y
index fdb177d..9a4a8fa 100644
--- a/contrib/cvs/lib/getdate.y
+++ b/contrib/cvs/lib/getdate.y
@@ -619,6 +619,10 @@ ToSeconds(Hours, Minutes, Seconds, Meridian)
}
+/* Year is either
+ * A negative number, which means to use its absolute value (why?)
+ * A number from 0 to 99, which means a year from 1900 to 1999, or
+ * The actual year (>=100). */
static time_t
Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
time_t Month;
@@ -710,7 +714,7 @@ RelativeMonth(Start, RelMonth)
if (RelMonth == 0)
return 0;
tm = localtime(&Start);
- Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
+ Month = 12 * (tm->tm_year + 1900) + tm->tm_mon + RelMonth;
Year = Month / 12;
Month = Month % 12 + 1;
return DSTcorrect(Start,
diff --git a/contrib/cvs/lib/getopt.h b/contrib/cvs/lib/getopt.h
index c872f414..7fc2cca 100644
--- a/contrib/cvs/lib/getopt.h
+++ b/contrib/cvs/lib/getopt.h
@@ -91,14 +91,14 @@ struct option
#define optional_argument 2
#if __STDC__
-#if defined(__GNU_LIBRARY__)
/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
+ differences in the consts, in stdlib.h. We used to try to prototype
+ it if __GNU_LIBRARY__ but that wasn't problem free either (I'm not sure
+ exactly why), and there is no particular need to prototype it.
+ We really shouldn't be trampling on the system's namespace at all by
+ declaring getopt() but that is a bigger issue. */
extern int getopt ();
-#endif /* not __GNU_LIBRARY__ */
+
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
diff --git a/contrib/cvs/lib/md5.c b/contrib/cvs/lib/md5.c
index 1003a40..f9a3cad 100644
--- a/contrib/cvs/lib/md5.c
+++ b/contrib/cvs/lib/md5.c
@@ -23,13 +23,16 @@
copyright in any changes I have made; this code remains in the
public domain. */
+/* Note regarding cvs_* namespace: this avoids potential conflicts
+ with libraries such as some versions of Kerberos. No particular
+ need to worry about whether the system supplies an MD5 library, as
+ this file is only about 3k of object code. */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#if HAVE_STRING_H || STDC_HEADERS
-#include <string.h> /* for memcpy() */
-#endif
+#include <string.h> /* for memcpy() and memset() */
/* Add prototype support. */
#ifndef PROTO
@@ -43,12 +46,12 @@
#include "md5.h"
/* Little-endian byte-swapping routines. Note that these do not
- depend on the size of datatypes such as uint32, nor do they require
+ depend on the size of datatypes such as cvs_uint32, nor do they require
us to detect the endianness of the machine we are running on. It
is possible they should be macros for speed, but I would be
surprised if they were a performance bottleneck for MD5. */
-static uint32
+static cvs_uint32
getu32 (addr)
const unsigned char *addr;
{
@@ -58,7 +61,7 @@ getu32 (addr)
static void
putu32 (data, addr)
- uint32 data;
+ cvs_uint32 data;
unsigned char *addr;
{
addr[0] = (unsigned char)data;
@@ -72,8 +75,8 @@ putu32 (data, addr)
* initialization constants.
*/
void
-MD5Init(ctx)
- struct MD5Context *ctx;
+cvs_MD5Init (ctx)
+ struct cvs_MD5Context *ctx;
{
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
@@ -89,17 +92,17 @@ MD5Init(ctx)
* of bytes.
*/
void
-MD5Update(ctx, buf, len)
- struct MD5Context *ctx;
+cvs_MD5Update (ctx, buf, len)
+ struct cvs_MD5Context *ctx;
unsigned char const *buf;
unsigned len;
{
- uint32 t;
+ cvs_uint32 t;
/* Update bitcount */
t = ctx->bits[0];
- if ((ctx->bits[0] = (t + ((uint32)len << 3)) & 0xffffffff) < t)
+ if ((ctx->bits[0] = (t + ((cvs_uint32)len << 3)) & 0xffffffff) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
@@ -116,7 +119,7 @@ MD5Update(ctx, buf, len)
return;
}
memcpy(p, buf, t);
- MD5Transform(ctx->buf, ctx->in);
+ cvs_MD5Transform (ctx->buf, ctx->in);
buf += t;
len -= t;
}
@@ -125,7 +128,7 @@ MD5Update(ctx, buf, len)
while (len >= 64) {
memcpy(ctx->in, buf, 64);
- MD5Transform(ctx->buf, ctx->in);
+ cvs_MD5Transform (ctx->buf, ctx->in);
buf += 64;
len -= 64;
}
@@ -140,9 +143,9 @@ MD5Update(ctx, buf, len)
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void
-MD5Final(digest, ctx)
+cvs_MD5Final (digest, ctx)
unsigned char digest[16];
- struct MD5Context *ctx;
+ struct cvs_MD5Context *ctx;
{
unsigned count;
unsigned char *p;
@@ -162,7 +165,7 @@ MD5Final(digest, ctx)
if (count < 8) {
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
- MD5Transform(ctx->buf, ctx->in);
+ cvs_MD5Transform (ctx->buf, ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
@@ -175,7 +178,7 @@ MD5Final(digest, ctx)
putu32(ctx->bits[0], ctx->in + 56);
putu32(ctx->bits[1], ctx->in + 60);
- MD5Transform(ctx->buf, ctx->in);
+ cvs_MD5Transform (ctx->buf, ctx->in);
putu32(ctx->buf[0], digest);
putu32(ctx->buf[1], digest + 4);
putu32(ctx->buf[2], digest + 8);
@@ -203,12 +206,12 @@ MD5Final(digest, ctx)
* the data and converts bytes into longwords for this routine.
*/
void
-MD5Transform(buf, inraw)
- uint32 buf[4];
+cvs_MD5Transform (buf, inraw)
+ cvs_uint32 buf[4];
const unsigned char inraw[64];
{
- register uint32 a, b, c, d;
- uint32 in[16];
+ register cvs_uint32 a, b, c, d;
+ cvs_uint32 in[16];
int i;
for (i = 0; i < 16; ++i)
@@ -302,7 +305,7 @@ MD5Transform(buf, inraw)
int
main (int argc, char **argv)
{
- struct MD5Context context;
+ struct cvs_MD5Context context;
unsigned char checksum[16];
int i;
int j;
@@ -315,9 +318,9 @@ main (int argc, char **argv)
for (j = 1; j < argc; ++j)
{
printf ("MD5 (\"%s\") = ", argv[j]);
- MD5Init (&context);
- MD5Update (&context, argv[j], strlen (argv[j]));
- MD5Final (checksum, &context);
+ cvs_MD5Init (&context);
+ cvs_MD5Update (&context, argv[j], strlen (argv[j]));
+ cvs_MD5Final (checksum, &context);
for (i = 0; i < 16; i++)
{
printf ("%02x", (unsigned int) checksum[i]);
diff --git a/contrib/cvs/lib/md5.h b/contrib/cvs/lib/md5.h
index 65bac1f..876b632 100644
--- a/contrib/cvs/lib/md5.h
+++ b/contrib/cvs/lib/md5.h
@@ -8,22 +8,19 @@
bits instead of 64 is not important; speed is considerably more
important. ANSI guarantees that "unsigned long" will be big enough,
and always using it seems to have few disadvantages. */
-typedef unsigned long uint32;
+typedef unsigned long cvs_uint32;
-struct MD5Context {
- uint32 buf[4];
- uint32 bits[2];
+struct cvs_MD5Context {
+ cvs_uint32 buf[4];
+ cvs_uint32 bits[2];
unsigned char in[64];
};
-void MD5Init PROTO((struct MD5Context *context));
-void MD5Update PROTO((struct MD5Context *context, unsigned char const *buf, unsigned len));
-void MD5Final PROTO((unsigned char digest[16], struct MD5Context *context));
-void MD5Transform PROTO((uint32 buf[4], const unsigned char in[64]));
-
-/*
- * This is needed to make RSAREF happy on some MS-DOS compilers.
- */
-typedef struct MD5Context MD5_CTX;
+void cvs_MD5Init PROTO ((struct cvs_MD5Context *context));
+void cvs_MD5Update PROTO ((struct cvs_MD5Context *context,
+ unsigned char const *buf, unsigned len));
+void cvs_MD5Final PROTO ((unsigned char digest[16],
+ struct cvs_MD5Context *context));
+void cvs_MD5Transform PROTO ((cvs_uint32 buf[4], const unsigned char in[64]));
#endif /* !MD5_H */
diff --git a/contrib/cvs/lib/memmove.c b/contrib/cvs/lib/memmove.c
index 8818d46..047a5a0 100644
--- a/contrib/cvs/lib/memmove.c
+++ b/contrib/cvs/lib/memmove.c
@@ -12,10 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+*/
/*
OpenPOWER on IntegriCloud