-- Increased some static buffer sizes.

-- Made Remind ignore trailing commas at end of tokens.
This commit is contained in:
dfs
1997-07-13 16:18:48 +00:00
parent 4c46eb5fee
commit f32e0027ad
4 changed files with 38 additions and 7 deletions

View File

@@ -4,12 +4,20 @@ CHANGES TO REMIND
+ MINOR ENHANCEMENTS
- Made Remind accept date specs like "Jan 6, 1998" -- the comma is
ignored. This was suggested by John Conover <john@johncon.johncon.com>.
You can even do "REM 27, Aug, 1998, msg bar". (But I don't know why
you'd want to.)
- Added www/rem2html, a Perl script which converts the output of
`remind -p ...' to an HTML table. The script was contributed by
Don Schwarz <darkowl@mcs.net>
+ BUG FIXES
- Increased sizes of some statically-allocated buffers. This doesn't
really fix the problem, but makes it more manageable.
- Added romanian.h to the manifest. Sorry.
- CalcMinsFromUTC was failing if time_t was unsigned. I now use

View File

@@ -11,7 +11,7 @@
/* */
/***************************************************************/
/* $Id: config.h,v 1.7 1997-03-30 19:07:37 dfs Exp $ */
/* $Id: config.h,v 1.8 1997-07-13 16:18:48 dfs Exp $ */
/*---------------------------------------------------------------------*/
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
@@ -160,7 +160,7 @@
/*---------------------------------------------------------------------*/
/* LINELEN: The maximum length of an input line */
/*---------------------------------------------------------------------*/
#define LINELEN 512
#define LINELEN 4096
/*---------------------------------------------------------------------*/
/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */
@@ -247,7 +247,7 @@
/*---------------------------------------------------------------------*/
/* The size of statically-allocated buffers for tokens. */
/*---------------------------------------------------------------------*/
#define TOKSIZE 128
#define TOKSIZE 1024
/*---------------------------------------------------------------------*/
/* The size of the buffer for the shell() function. */

6
main.c
View File

@@ -11,7 +11,7 @@
/***************************************************************/
#include "config.h"
static char const RCSID[] = "$Id: main.c,v 1.7 1997-07-06 14:34:37 dfs Exp $";
static char const RCSID[] = "$Id: main.c,v 1.8 1997-07-13 16:18:49 dfs Exp $";
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -502,6 +502,10 @@ char *out;
len++;
}
}
/* Ignore trailing commas */
if (len > 0 && *(out-1) == ',') {
out--;
}
*out = 0;
return OK;
}

25
token.c
View File

@@ -11,7 +11,7 @@
/***************************************************************/
#include "config.h"
static char const RCSID[] = "$Id: token.c,v 1.4 1997-03-30 19:07:50 dfs Exp $";
static char const RCSID[] = "$Id: token.c,v 1.5 1997-07-13 16:18:49 dfs Exp $";
#include <stdio.h>
#include <string.h>
@@ -159,10 +159,15 @@ char *s;
if (len < TOKSIZE) {
*t++ = *s++;
len++;
}else s++;
} else s++;
}
*t = 0;
/* Ignore trailing commas */
if (t > TokBuffer && *(t-1) == ',') {
*(t-1) = 0;
} else {
*t = 0;
}
FindToken(TokBuffer, tok);
return s;
@@ -274,6 +279,20 @@ Token *t;
if (isdigit(*s)) {
PARSENUM(t->val, s);
/* If we hit a comma, swallow it. This allows stuff
like Jan 6, 1998 */
if (*s == ',') {
s++;
/* Special hack - convert years between 90 and
99 to 1990 and 1999 */
if (t->val >= 90 && t->val <= 99) t->val += 1900;
/* Classify the number we've got */
if (t->val >= BASE && t->val <= BASE+YR_RANGE) t->type = T_Year;
else if (t->val >= 1 && t->val <= 31) t->type = T_Day;
else t->type = T_Number;
return;
}
/* If we hit a colon or a period, we've probably got a time hr:min */
if (*s == ':' || *s == '.' || *s == TIMESEP) {
s++;