projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sigh, vasnprintf changed in gnulib
[gnulib.git]
/
lib
/
posixtm.c
diff --git
a/lib/posixtm.c
b/lib/posixtm.c
index
49e239c
..
22f636e
100644
(file)
--- a/
lib/posixtm.c
+++ b/
lib/posixtm.c
@@
-1,5
+1,7
@@
/* Parse dates for touch and date.
/* Parse dates for touch and date.
- Copyright (C) 1989, 1990, 1991, 1998, 2000-2003 Free Software Foundation Inc.
+
+ Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004
+ 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
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
@@
-25,15
+27,9
@@
#include <stdbool.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdio.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/types.h>
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
#ifdef TM_IN_SYS_TIME
# include <sys/time.h>
#ifdef TM_IN_SYS_TIME
# include <sys/time.h>
@@
-51,7
+47,7
@@
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
ISDIGIT_LOCALE unless it's important to use the locale's definition
of `digit' even when the host does not conform to POSIX. */
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
ISDIGIT_LOCALE unless it's important to use the locale's definition
of `digit' even when the host does not conform to POSIX. */
-#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
+#define ISDIGIT(c) ((unsigned
int
) (c) - '0' <= 9)
time_t mktime ();
time_t mktime ();
@@
-119,7
+115,7
@@
posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits)
const char *dot = NULL;
int pair[6];
int *p;
const char *dot = NULL;
int pair[6];
int *p;
-
unsigned in
t i;
+
size_
t i;
size_t s_len = strlen (s);
size_t len = (((syntax_bits & PDS_SECONDS) && (dot = strchr (s, '.')))
size_t s_len = strlen (s);
size_t len = (((syntax_bits & PDS_SECONDS) && (dot = strchr (s, '.')))
@@
-294,7
+290,7
@@
END-DATA
# define MAX_BUFF_LEN 1024
int
# define MAX_BUFF_LEN 1024
int
-main ()
+main (
void
)
{
char buff[MAX_BUFF_LEN + 1];
{
char buff[MAX_BUFF_LEN + 1];
@@
-310,7
+306,7
@@
main ()
{
printf ("%-15s %2u ", time_str, syntax_bits);
if (posixtime (&t, time_str, syntax_bits))
{
printf ("%-15s %2u ", time_str, syntax_bits);
if (posixtime (&t, time_str, syntax_bits))
- printf ("%12ld %s", (long) t, ctime (&t));
+ printf ("%12ld %s", (long
int
) t, ctime (&t));
else
printf ("%12s %s", "*", "*\n");
}
else
printf ("%12s %s", "*", "*\n");
}