From ec90359f3456b5256c45f6b17fc1a0e6964ed2f6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 1 Oct 1994 02:52:05 +0000 Subject: [PATCH] . --- src/basename.c | 3 --- src/date.c | 39 +++++++++++---------------------------- src/dirname.c | 3 --- src/echo.c | 3 --- src/env.c | 3 --- src/expr.c | 3 --- src/hostname.c | 3 --- src/id.c | 3 --- src/logname.c | 3 --- src/nice.c | 3 --- src/pathchk.c | 3 --- src/printenv.c | 3 --- src/printf.c | 3 --- src/pwd.c | 3 --- src/sleep.c | 3 --- src/stty.c | 3 --- src/su.c | 3 --- src/tee.c | 3 --- src/test.c | 3 --- src/tty.c | 3 --- src/uname.c | 3 --- src/who.c | 3 --- src/whoami.c | 3 --- src/yes.c | 5 +---- 24 files changed, 12 insertions(+), 98 deletions(-) diff --git a/src/basename.c b/src/basename.c index 10726d2..1c8a058 100644 --- a/src/basename.c +++ b/src/basename.c @@ -25,10 +25,7 @@ basename functions.lisp p => functions.lis */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/src/date.c b/src/date.c index fe129b9..da33d41 100644 --- a/src/date.c +++ b/src/date.c @@ -13,36 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Options: - -d DATESTR Display the date DATESTR. - -s DATESTR Set the date to DATESTR. - -u Display or set the date in universal instead of local time. - +FORMAT Specify custom date output format, described below. - MMDDhhmm[[CC]YY][.ss] Set the date in the format described below. - - If one non-option argument is given, it is used as the date to which - to set the system clock, and must have the format: - MM month (01..12) - DD day in month (01..31) - hh hour (00..23) - mm minute (00..59) - CC first 2 digits of year (optional, defaults to current) (00..99) - YY last 2 digits of year (optional, defaults to current) (00..99) - ss second (00..61) - - If a non-option argument that starts with a `+' is specified, it - is used to control the format in which the date is printed; it - can contain any of the `%' substitutions allowed by the strftime - function. A newline is always added at the end of the output. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. David MacKenzie */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -97,7 +72,11 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; -/* FIXME: comment */ +/* Parse each line in INPUT_FILENAME as with --date and display the + each resulting time and date. If the file cannot be opened, tell why + then exit. Issue a diagnostic for any lines that cannot be parsed. + If any line cannot be parsed, return non-zero; otherwise return zero. + */ static int batch_convert (const char *input_filename, const char *format) @@ -144,7 +123,10 @@ batch_convert (const char *input_filename, const char *format) error (0, 0, "invalid date `%s'", line); status = 1; } - show_date (format, when); + else + { + show_date (format, when); + } } if (have_read_stdin && fclose (stdin) == EOF) @@ -350,6 +332,7 @@ Usage: %s [OPTION]... [+FORMAT]\n\ printf ("\ \n\ -d, --date=STRING display time described by STRING, not `now'\n\ + -f, --file=DATEFILE like --date once for each line of DATEFILE\n\ -s, --set=STRING set time described by STRING\n\ -u, --utc, --universal print or set Coordinated Universal Time\n\ --help display this help and exit\n\ diff --git a/src/dirname.c b/src/dirname.c index 22e983d..3fb5c1a 100644 --- a/src/dirname.c +++ b/src/dirname.c @@ -17,10 +17,7 @@ /* Written by David MacKenzie and Jim Meyering. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/src/echo.c b/src/echo.c index ea7510e..ee2402a 100644 --- a/src/echo.c +++ b/src/echo.c @@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along with Bash; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include "system.h" diff --git a/src/env.c b/src/env.c index 46a4071..19c2a62 100644 --- a/src/env.c +++ b/src/env.c @@ -77,10 +77,7 @@ { LOGNAME=foo PATH=/energy } */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/expr.c b/src/expr.c index 7cf9110..e1ee8e7 100644 --- a/src/expr.c +++ b/src/expr.c @@ -28,10 +28,7 @@ Define EVAL_TRACE to print an evaluation trace. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/hostname.c b/src/hostname.c index 2a79398..df533a5 100644 --- a/src/hostname.c +++ b/src/hostname.c @@ -17,10 +17,7 @@ /* Jim Meyering */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/src/id.c b/src/id.c index 7061466..92f2bd6 100644 --- a/src/id.c +++ b/src/id.c @@ -18,10 +18,7 @@ /* Written by Arnold Robbins, arnold@audiofax.com. Major rewrite by David MacKenzie, djm@gnu.ai.mit.edu. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/logname.c b/src/logname.c index bc21afc..7b152e5 100644 --- a/src/logname.c +++ b/src/logname.c @@ -15,10 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/nice.c b/src/nice.c index 444131f..9f33866 100644 --- a/src/nice.c +++ b/src/nice.c @@ -17,10 +17,7 @@ /* David MacKenzie */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #define NDEBUG diff --git a/src/pathchk.c b/src/pathchk.c index 3b7c8e5..de8bc6c 100644 --- a/src/pathchk.c +++ b/src/pathchk.c @@ -38,10 +38,7 @@ David MacKenzie and Jim Meyering */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/printenv.c b/src/printenv.c index 4ddaeba..bbdca9d 100644 --- a/src/printenv.c +++ b/src/printenv.c @@ -27,10 +27,7 @@ David MacKenzie and Richard Mlynarik */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/printf.c b/src/printf.c index c472811..e437abe 100644 --- a/src/printf.c +++ b/src/printf.c @@ -43,10 +43,7 @@ David MacKenzie */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/pwd.c b/src/pwd.c index 8da058a..807e77b 100644 --- a/src/pwd.c +++ b/src/pwd.c @@ -17,10 +17,7 @@ /* Jim Meyering */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/src/sleep.c b/src/sleep.c index dda1ea4..f584f5c 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -15,10 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/stty.c b/src/stty.c index 5efeb24..b98d1a9 100644 --- a/src/stty.c +++ b/src/stty.c @@ -27,10 +27,7 @@ David MacKenzie */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/su.c b/src/su.c index e67d048..4a16407 100644 --- a/src/su.c +++ b/src/su.c @@ -69,10 +69,7 @@ Written by David MacKenzie . */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/tee.c b/src/tee.c index ca1e271..de0348b 100644 --- a/src/tee.c +++ b/src/tee.c @@ -17,10 +17,7 @@ /* Mike Parker, Richard M. Stallman, and David MacKenzie */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/test.c b/src/test.c index 7aefb0a..6830ca7 100644 --- a/src/test.c +++ b/src/test.c @@ -24,10 +24,7 @@ the shell builtin version. */ /* #define TEST_STANDALONE */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/src/tty.c b/src/tty.c index 3d6c532..f7ad301 100644 --- a/src/tty.c +++ b/src/tty.c @@ -22,10 +22,7 @@ Written by David MacKenzie . */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/uname.c b/src/uname.c index ae34b54..39b1702 100644 --- a/src/uname.c +++ b/src/uname.c @@ -28,10 +28,7 @@ David MacKenzie */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/who.c b/src/who.c index c173977..acfd1d0 100644 --- a/src/who.c +++ b/src/who.c @@ -32,10 +32,7 @@ -H Print column headings at top. -w, -T -s plus mesg (+ or -, or ? if bad line). */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/src/whoami.c b/src/whoami.c index 6bb4315..233313e 100644 --- a/src/whoami.c +++ b/src/whoami.c @@ -18,10 +18,7 @@ /* Equivalent to `id -un'. */ /* Written by Richard Mlynarik. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/yes.c b/src/yes.c index 68bf9ae..bb7539b 100644 --- a/src/yes.c +++ b/src/yes.c @@ -17,10 +17,7 @@ /* David MacKenzie */ -#ifdef HAVE_CONFIG_H - -#endif - +#include #include #include -- 2.7.4