/*
* dp.c -- parse dates 822-style
*
- * $Id$
+ * This code is Copyright (c) 2002, by the authors of nmh. See the
+ * COPYRIGHT file in the root directory of the nmh distribution for
+ * complete copyright information.
*/
#include <h/mh.h>
#include <h/fmt_scan.h>
-#include <zotnet/tws/tws.h>
+#include <h/tws.h>
#define NDATES 100
#define VERSIONSW 3
{ "version", 0 },
#define HELPSW 4
- { "help", 4 },
+ { "help", 0 },
{ NULL, 0 }
};
static int dat[5];
/*
- * prototypes
- */
-int sc_width (void); /* from termsbr.c */
-
-/*
* static prototypes
*/
static int process (char *, int);
snprintf (buf, sizeof(buf), "%s [switches] dates ...",
invo_name);
print_help (buf, switches, 1);
- done (1);
+ done (0);
case VERSIONSW:
print_version(invo_name);
- done (1);
+ done (0);
case FORMSW:
if (!(form = *argp++) || *form == '-')
status += process (dates[datep], width);
context_save (); /* save the context file */
- return done (status);
+ done (status);
+ return 1;
}
FINDCOMP (cptr, "text");
if (cptr)
cptr->c_text = date;
- fmt_scan (fmt, buffer, length, dat);
+ fmt_scan (fmt, buffer, sizeof buffer - 1, length, dat);
fputs (buffer, stdout);
return status;