mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9dea59206 | ||
|
|
46aa144b65 | ||
|
|
914971308d | ||
|
|
a22e81040f | ||
|
|
72f74f03cf | ||
|
|
d0e45e727e | ||
|
|
ce2b2e80da | ||
|
|
11771b7d3d | ||
|
|
01cb028532 | ||
|
|
58b6f43b9c | ||
|
|
1dedb667e8 | ||
|
|
8a96236788 | ||
|
|
2a13163659 | ||
|
|
336a9684d4 | ||
|
|
86945c6e18 | ||
|
|
684280db5e |
18
configure
vendored
18
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.71 for remind 05.00.04.
|
||||
# Generated by GNU Autoconf 2.71 for remind 05.00.05.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
|
||||
@@ -608,8 +608,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='remind'
|
||||
PACKAGE_TARNAME='remind'
|
||||
PACKAGE_VERSION='05.00.04'
|
||||
PACKAGE_STRING='remind 05.00.04'
|
||||
PACKAGE_VERSION='05.00.05'
|
||||
PACKAGE_STRING='remind 05.00.05'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL='https://dianne.skoll.ca/projects/remind/'
|
||||
|
||||
@@ -1264,7 +1264,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures remind 05.00.04 to adapt to many kinds of systems.
|
||||
\`configure' configures remind 05.00.05 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1326,7 +1326,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of remind 05.00.04:";;
|
||||
short | recursive ) echo "Configuration of remind 05.00.05:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1414,7 +1414,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
remind configure 05.00.04
|
||||
remind configure 05.00.05
|
||||
generated by GNU Autoconf 2.71
|
||||
|
||||
Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
@@ -1864,7 +1864,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by remind $as_me 05.00.04, which was
|
||||
It was created by remind $as_me 05.00.05, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
$ $0$ac_configure_args_raw
|
||||
@@ -4703,7 +4703,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by remind $as_me 05.00.04, which was
|
||||
This file was extended by remind $as_me 05.00.05, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -4768,7 +4768,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config='$ac_cs_config_escaped'
|
||||
ac_cs_version="\\
|
||||
remind config.status 05.00.04
|
||||
remind config.status 05.00.05
|
||||
configured by $0, generated by GNU Autoconf 2.71,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(remind, 05.00.04, , , https://dianne.skoll.ca/projects/remind/)
|
||||
AC_INIT(remind, 05.00.05, , , https://dianne.skoll.ca/projects/remind/)
|
||||
AC_CONFIG_SRCDIR([src/queue.c])
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
@@ -264,7 +264,7 @@ foreach $yearkey (sort keys %{$events} ) {
|
||||
if ($start->hour > 0) {
|
||||
print " AT ";
|
||||
print $start->strftime("%H:%M");
|
||||
print " SCHED _sfun MSG %a %2 ";
|
||||
print " +15 MSG %a %2 ";
|
||||
} else {
|
||||
print " MSG %a ";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,35 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* VERSION 5.0 Patch 5 - 2024-09-02
|
||||
|
||||
* CHANGE: remind: When using the "-c" option and with the SHADE special
|
||||
enabled, shade the entire calendar box including the line containing the
|
||||
day number.
|
||||
|
||||
* IMPROVEMENT: remind: Better error messages when diagnosing certain
|
||||
errors in expressions.
|
||||
|
||||
* IMPROVEMENT: include/holidays/jewish.rem: Remove unnecessary _h()
|
||||
function definition.
|
||||
|
||||
* BUG FIX: remind: In a couple of spots when we parsed a character, we did
|
||||
not check for an error return. This has been fixed.
|
||||
|
||||
* BUG FIX: remind: Fix edge-case bugs in "remind -c" output formatting.
|
||||
|
||||
* BUG FIX: make test: Fix a test that was broken for all of September 2024.
|
||||
|
||||
* BUG FIX: remind: Fix a couple of potential file-descriptor leaks.
|
||||
|
||||
* BUG FIX: contrib/ical2rem.pl: Replace "SCHED _sfun" with "+15" to
|
||||
hard-code 15-minutes advance warning rather than using an undefined
|
||||
scheduling function. If this is not what you want, you should edit
|
||||
ical2rem.pl to suit your taste; it's not officially part of Remind and
|
||||
is meant more as a starting point for you to customize than a finished
|
||||
product.
|
||||
|
||||
* DOCUMENTATION FIX: Remove obsolete info from Remind man page.
|
||||
|
||||
* VERSION 5.0 Patch 4 - 2024-08-29
|
||||
|
||||
* IMPROVEMENT: remind: When checking if a SATISFY expression refers to the
|
||||
|
||||
@@ -10,7 +10,6 @@ SET InIsrael value("InIsrael", 0)
|
||||
SET Reform value("Reform", 0)
|
||||
|
||||
# Convenient function definition to save typing
|
||||
FSET _h(x, y) HEBDATE(x,y)
|
||||
FSET _h2(x, y) HEBDATE(x, y, $U-7)
|
||||
FSET _PastSat(x, y) IIF(WKDAYNUM(_h2(x,y))!=6, _h2(x,y), _h2(x,y)+1)
|
||||
FSET _BackTwoFri(x, y) IIF(WKDAYNUM(_h2(x,y))!=5, _h2(x,y), _h2(x,y)-2)
|
||||
@@ -19,28 +18,28 @@ FSET _BackTwoSat(x, y) IIF(WKDAYNUM(_h2(x,y))!=6, _h2(x,y), _h2(x,y)-2)
|
||||
SET InIsrael VALUE("InIsrael", 0)
|
||||
SET Reform VALUE("Reform", 0)
|
||||
|
||||
REM [_h(1, "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b.
|
||||
REM [hebdate(1, "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b.
|
||||
|
||||
# No RH-2 or Tzom Gedalia in Reform
|
||||
IF !Reform
|
||||
REM [_h(2, "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b.
|
||||
REM [hebdate(2, "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b.
|
||||
REM [_PastSat(3, "Tishrey")] ++4 MSG %"Tzom Gedalia%" is %b.
|
||||
ENDIF
|
||||
|
||||
REM [_h(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b.
|
||||
REM [_h(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b.
|
||||
REM [hebdate(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b.
|
||||
REM [hebdate(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b.
|
||||
|
||||
IF !InIsrael
|
||||
REM [_h(16, "Tishrey")] MSG %"Sukkot 2%"
|
||||
REM [hebdate(16, "Tishrey")] MSG %"Sukkot 2%"
|
||||
ENDIF
|
||||
|
||||
REM [_h(21, "Tishrey")] ++4 MSG %"Hoshana Rabba%" is %b.
|
||||
REM [_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
|
||||
REM [hebdate(21, "Tishrey")] ++4 MSG %"Hoshana Rabba%" is %b.
|
||||
REM [hebdate(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
|
||||
|
||||
IF InIsrael
|
||||
REM [_h(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
|
||||
REM [hebdate(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
|
||||
ELSE
|
||||
REM [_h(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
|
||||
REM [hebdate(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
|
||||
ENDIF
|
||||
|
||||
# Because Kislev can change length, we must be more careful about Chanukah
|
||||
@@ -58,11 +57,11 @@ REM [_chan(8)] MSG %"Chanukah 8%"
|
||||
IF !Reform
|
||||
# 10 Tevet will never be a Saturday, so whether or not to
|
||||
# move it is moot. (Thanks to Art Werschulz.)
|
||||
REM [_h(10, "Tevet")] MSG %"Tzom Tevet%" is %b.
|
||||
REM [hebdate(10, "Tevet")] MSG %"Tzom Tevet%" is %b.
|
||||
ENDIF
|
||||
|
||||
REM [_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
|
||||
REM [_h(14, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
|
||||
REM [hebdate(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
|
||||
REM [hebdate(14, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
|
||||
|
||||
# If Purim is on Sunday, then Fast of Esther is 11 Adar.
|
||||
IF WKDAYNUM(_h2(13, "Adar")) != 6
|
||||
@@ -70,33 +69,33 @@ IF WKDAYNUM(_h2(13, "Adar")) != 6
|
||||
ELSE
|
||||
REM [_h2(11, "Adar")] ++4 MSG %"Fast of Esther%" is %b.
|
||||
ENDIF
|
||||
REM [_h(14, "Adar")] ++4 MSG %"Purim%" is %b.
|
||||
REM [_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
|
||||
REM [hebdate(14, "Adar")] ++4 MSG %"Purim%" is %b.
|
||||
REM [hebdate(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
|
||||
|
||||
IF !InIsrael
|
||||
REM [_h(16, "Nisan")] MSG %"Pesach 2%"
|
||||
REM [hebdate(16, "Nisan")] MSG %"Pesach 2%"
|
||||
ENDIF
|
||||
|
||||
REM [_h(21, "Nisan")] MSG %"Pesach 7%"
|
||||
REM [hebdate(21, "Nisan")] MSG %"Pesach 7%"
|
||||
|
||||
IF !InIsrael && !Reform
|
||||
REM [_h(22, "Nisan")] MSG %"Pesach 8%"
|
||||
REM [hebdate(22, "Nisan")] MSG %"Pesach 8%"
|
||||
ENDIF
|
||||
|
||||
REM [_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
|
||||
REM [hebdate(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
|
||||
REM [_BackTwoFri(4, "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b.
|
||||
REM [_BackTwoSat(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
|
||||
# Not sure about Reform's position on Lag B'Omer
|
||||
IF !Reform
|
||||
REM [_h(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b.
|
||||
REM [hebdate(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b.
|
||||
ENDIF
|
||||
|
||||
REM [_h(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b.
|
||||
REM [_h(6, "Sivan")] ++4 MSG %"Shavuot%" is %b.
|
||||
REM [hebdate(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b.
|
||||
REM [hebdate(6, "Sivan")] ++4 MSG %"Shavuot%" is %b.
|
||||
|
||||
IF !InIsrael && !Reform
|
||||
REM [_h(7, "Sivan")] MSG %"Shavuot 2%"
|
||||
REM [hebdate(7, "Sivan")] MSG %"Shavuot 2%"
|
||||
ENDIF
|
||||
|
||||
# Fairly sure Reform Jews don't observe the next two
|
||||
|
||||
@@ -4706,10 +4706,7 @@ This is really useful only if \fIexpr\fR involves a call to the
|
||||
\fIexpr\fR will not change as \fBRemind\fR iterates. In fact, if
|
||||
\fIexpr\fR is not a constant and does not call \fBtrigdate()\fR or
|
||||
related functions or system variables, then \fBRemind\fR will issue a
|
||||
warning. If you have a user-defined function that calls
|
||||
\fBtrigdate()\fR, this can result in an unwanted warning. In that
|
||||
case, pass \fBtrigdate()\fR or some related function or system
|
||||
variable into your user-defined function from the SATISFY expression.
|
||||
warning.
|
||||
.PP
|
||||
An example of the usefulness of \fBSATISFY\fR: Suppose you wish to
|
||||
be warned of every Friday the 13th. Your first attempt may be:
|
||||
|
||||
@@ -338,6 +338,7 @@ UnBackgroundize(int d)
|
||||
printf("%s", Decolorize());
|
||||
}
|
||||
|
||||
#ifdef REM_USE_WCHAR
|
||||
static void
|
||||
send_lrm(void)
|
||||
{
|
||||
@@ -352,6 +353,7 @@ send_lrm(void)
|
||||
printf("\xE2\x80\x8E");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static char const *
|
||||
despace(char const *s)
|
||||
@@ -526,9 +528,9 @@ get_month_abbrev(char const *mon)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef REM_USE_WCHAR
|
||||
static int make_wchar_versions(CalEntry *e)
|
||||
{
|
||||
#ifdef REM_USE_WCHAR
|
||||
size_t len;
|
||||
wchar_t *buf;
|
||||
len = mbstowcs(NULL, e->text, 0);
|
||||
@@ -542,10 +544,8 @@ static int make_wchar_versions(CalEntry *e)
|
||||
e->wc_text = buf;
|
||||
e->wc_pos = buf;
|
||||
return 1;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gon(void)
|
||||
{
|
||||
@@ -900,13 +900,17 @@ static void DoCalendarOneWeek(int nleft)
|
||||
if (UseVTColors) {
|
||||
printf("\x1B[1m"); /* Bold */
|
||||
}
|
||||
Backgroundize(d);
|
||||
PrintLeft(buf, ColSpaces-1, '*');
|
||||
putchar(' ');
|
||||
UnBackgroundize(d);
|
||||
if (UseVTColors) {
|
||||
printf("\x1B[0m"); /* Normal */
|
||||
}
|
||||
putchar(' ');
|
||||
} else {
|
||||
Backgroundize(d);
|
||||
PrintLeft(buf, ColSpaces, ' ');
|
||||
UnBackgroundize(d);
|
||||
}
|
||||
gon();
|
||||
DRAW(tb);
|
||||
@@ -1122,13 +1126,17 @@ static int WriteCalendarRow(void)
|
||||
if (UseVTColors) {
|
||||
printf("\x1B[1m"); /* Bold */
|
||||
}
|
||||
Backgroundize(d+i-wd);
|
||||
PrintLeft(buf, ColSpaces-1, '*');
|
||||
putchar(' ');
|
||||
if (UseVTColors) {
|
||||
printf("\x1B[0m"); /* Normal */
|
||||
}
|
||||
putchar(' ');
|
||||
UnBackgroundize(d+i-wd);
|
||||
} else {
|
||||
Backgroundize(d+i-wd);
|
||||
PrintLeft(buf, ColSpaces, ' ');
|
||||
UnBackgroundize(d+i-wd);
|
||||
}
|
||||
}
|
||||
gon();
|
||||
@@ -1196,15 +1204,17 @@ static void PrintLeft(char const *s, int width, char pad)
|
||||
{
|
||||
#ifndef REM_USE_WCHAR
|
||||
int len = strlen(s);
|
||||
printf("%s", s);
|
||||
while (len++ < width) putchar(pad);
|
||||
int i;
|
||||
for (i=0; i<len && i<width; i++) {
|
||||
fputc(*(s+i), stdout);
|
||||
}
|
||||
while (i++ < width) putchar(pad);
|
||||
#else
|
||||
size_t len = mbstowcs(NULL, s, 0);
|
||||
int i;
|
||||
wchar_t static_buf[128];
|
||||
wchar_t *buf;
|
||||
wchar_t *ws;
|
||||
int display_len;
|
||||
|
||||
if (!len) {
|
||||
for (i=0; i<width; i++) {
|
||||
@@ -1223,13 +1233,16 @@ static void PrintLeft(char const *s, int width, char pad)
|
||||
}
|
||||
}
|
||||
(void) mbstowcs(buf, s, len+1);
|
||||
display_len = wcswidth(buf, len+1);
|
||||
|
||||
ws = buf;
|
||||
for (i=0; i<width;) {
|
||||
i=0;
|
||||
while (i<width) {
|
||||
if (*ws) {
|
||||
if (i + wcwidth(*ws) > width) {
|
||||
break;
|
||||
}
|
||||
i += wcwidth(*ws);
|
||||
PutWideChar(*ws++, NULL);
|
||||
i+= wcwidth(*ws);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -1242,7 +1255,10 @@ static void PrintLeft(char const *s, int width, char pad)
|
||||
/* Possibly send lrm control sequence */
|
||||
send_lrm();
|
||||
|
||||
for (i=display_len; i<width; i++) fputc(pad, stdout);
|
||||
while (i<width) {
|
||||
fputc(pad, stdout);
|
||||
i++;
|
||||
}
|
||||
if (buf != static_buf) free(buf);
|
||||
#endif
|
||||
|
||||
@@ -1263,7 +1279,7 @@ static void PrintCentered(char const *s, int width, char *pad)
|
||||
int i;
|
||||
|
||||
for (i=0; i<d; i++) fputs(pad, stdout);
|
||||
for (i=0; i<width; i++) {
|
||||
for (i=0; i<width-d; i++) {
|
||||
if (*s) {
|
||||
if (isspace(*s)) {
|
||||
putchar(' ');
|
||||
@@ -1307,13 +1323,14 @@ static void PrintCentered(char const *s, int width, char *pad)
|
||||
if (d < 0) d = 0;
|
||||
ws = buf;
|
||||
for (i=0; i<d; i++) fputs(pad, stdout);
|
||||
for (i=0; i<width; i++) {
|
||||
i=0;
|
||||
while (i+d < width) {
|
||||
if (*ws) {
|
||||
PutWideChar(*ws++, NULL);
|
||||
if (wcwidth(*ws) == 0) {
|
||||
/* Don't count this character... it's zero-width */
|
||||
i--;
|
||||
if (i+d + wcwidth(*ws) > width) {
|
||||
break;
|
||||
}
|
||||
i += wcwidth(*ws);
|
||||
PutWideChar(*ws++, NULL);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -1325,7 +1342,10 @@ static void PrintCentered(char const *s, int width, char *pad)
|
||||
/* Possibly send lrm control sequence */
|
||||
send_lrm();
|
||||
|
||||
for (i=d+display_len; i<width; i++) fputs(pad, stdout);
|
||||
while (i+d<width) {
|
||||
fputs(pad, stdout);
|
||||
i++;
|
||||
}
|
||||
if (buf != static_buf) free(buf);
|
||||
#endif
|
||||
}
|
||||
@@ -2143,7 +2163,9 @@ static int DoCalRem(ParsePtr p, int col)
|
||||
FreeTrig(&trig);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
#ifdef REM_USE_WCHAR
|
||||
make_wchar_versions(e);
|
||||
#endif
|
||||
DBufInit(&(e->tags));
|
||||
DBufPuts(&(e->tags), DBufValue(&(trig.tags)));
|
||||
if (SynthesizeTags) {
|
||||
|
||||
31
src/expr.c
31
src/expr.c
@@ -1555,9 +1555,10 @@ static int parse_expr_token_aux(DynamicBuffer *buf, char const **in)
|
||||
return E_NO_MEM;
|
||||
}
|
||||
(*in)++;
|
||||
}
|
||||
return OK;
|
||||
|
||||
} else {
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
return OK;
|
||||
case '!':
|
||||
case '>':
|
||||
case '<':
|
||||
@@ -1778,6 +1779,7 @@ static expr_node * parse_function_call(char const **e, int *r, Var *locals, int
|
||||
expr_node *node;
|
||||
expr_node *arg;
|
||||
char *s;
|
||||
char const *ptr;
|
||||
CHECK_PARSE_LEVEL();
|
||||
|
||||
node = alloc_expr_node(r);
|
||||
@@ -1850,6 +1852,7 @@ static expr_node * parse_function_call(char const **e, int *r, Var *locals, int
|
||||
}
|
||||
}
|
||||
if (TOKEN_IS(")")) {
|
||||
ptr = *e;
|
||||
*r = GET_TOKEN();
|
||||
if (*r != OK) {
|
||||
return free_expr_tree(node);
|
||||
@@ -1858,8 +1861,14 @@ static expr_node * parse_function_call(char const **e, int *r, Var *locals, int
|
||||
/* Check args for builtin funcs */
|
||||
if (node->type == N_BUILTIN_FUNC) {
|
||||
f = node->u.builtin_func;
|
||||
if (node->num_kids < f->minargs) *r = E_2FEW_ARGS;
|
||||
if (node->num_kids > f->maxargs && f->maxargs != NO_MAX) *r = E_2MANY_ARGS;
|
||||
if (node->num_kids < f->minargs) {
|
||||
*e = ptr;
|
||||
*r = E_2FEW_ARGS;
|
||||
}
|
||||
if (node->num_kids > f->maxargs && f->maxargs != NO_MAX) {
|
||||
*e = ptr;
|
||||
*r = E_2MANY_ARGS;
|
||||
}
|
||||
}
|
||||
if (*r != OK) {
|
||||
if (node->type == N_BUILTIN_FUNC) {
|
||||
@@ -2502,15 +2511,23 @@ expr_node *parse_expression(char const **e, int *r, Var *locals)
|
||||
}
|
||||
}
|
||||
if (*r == E_EXPECT_COMMA ||
|
||||
*r == E_PARSE_ERR ||
|
||||
*r == E_MISS_RIGHT_PAREN ||
|
||||
*r == E_EXPECTING_EOL ||
|
||||
*r == E_2MANY_ARGS ||
|
||||
*r == E_2FEW_ARGS ||
|
||||
*r == E_PARSE_ERR ||
|
||||
*r == E_EOLN ||
|
||||
*r == E_ILLEGAL_CHAR) {
|
||||
orig = o2;
|
||||
while (*orig) {
|
||||
fprintf(ErrFp, "%c", *orig++);
|
||||
if (*orig == '\n') {
|
||||
fprintf(ErrFp, " ");
|
||||
orig++;
|
||||
} else if (*orig == ']' && ! *(orig+1)) {
|
||||
break;
|
||||
} else {
|
||||
fprintf(ErrFp, "%c", *orig++);
|
||||
}
|
||||
}
|
||||
fprintf(ErrFp, "\n");
|
||||
orig = o2;
|
||||
|
||||
@@ -1119,6 +1119,8 @@ guess_terminal_background(int *r, int *g, int *b)
|
||||
|
||||
if (n != 8) {
|
||||
/* write failed... WTF? Not much we can do */
|
||||
tty_reset(ttyfd);
|
||||
close(ttyfd);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1142,6 +1144,7 @@ guess_terminal_background(int *r, int *g, int *b)
|
||||
return;
|
||||
}
|
||||
tty_reset(ttyfd);
|
||||
close(ttyfd);
|
||||
buf[n+1] = 0;
|
||||
if (n < 25) {
|
||||
/* Too short */
|
||||
|
||||
@@ -207,6 +207,11 @@ int DoFset(ParsePtr p)
|
||||
local_array[i+1].next = NULL;
|
||||
func->nargs++;
|
||||
c = ParseNonSpaceChar(p, &r, 0);
|
||||
if (r) {
|
||||
DBufFree(&buf);
|
||||
DestroyUserFunc(func);
|
||||
return r;
|
||||
}
|
||||
if (c == ')') break;
|
||||
else if (c != ',') {
|
||||
DestroyUserFunc(func);
|
||||
@@ -217,6 +222,10 @@ int DoFset(ParsePtr p)
|
||||
|
||||
/* Allow an optional = sign: FSET f(x) = x*x */
|
||||
c = ParseNonSpaceChar(p, &r, 1);
|
||||
if (r) {
|
||||
DestroyUserFunc(func);
|
||||
return r;
|
||||
}
|
||||
if (c == '=') {
|
||||
(void) ParseNonSpaceChar(p, &r, 0);
|
||||
}
|
||||
@@ -241,8 +250,9 @@ int DoFset(ParsePtr p)
|
||||
}
|
||||
|
||||
c = ParseNonSpaceChar(p, &r, 1);
|
||||
if (c != 0) {
|
||||
if (c != 0 || r != 0) {
|
||||
DestroyUserFunc(func);
|
||||
if (r != 0) return r;
|
||||
return E_EXPECTING_EOL;
|
||||
}
|
||||
|
||||
|
||||
@@ -587,7 +587,7 @@ int DoSet (Parser *p)
|
||||
{
|
||||
Value v;
|
||||
int r;
|
||||
|
||||
int ch;
|
||||
DynamicBuffer buf;
|
||||
DynamicBuffer buf2;
|
||||
DBufInit(&buf);
|
||||
@@ -597,8 +597,11 @@ int DoSet (Parser *p)
|
||||
if (r) return r;
|
||||
|
||||
/* Allow optional equals-sign: SET var = value */
|
||||
if (ParseNonSpaceChar(p, &r, 1) == '=') {
|
||||
ch = ParseNonSpaceChar(p, &r, 1);
|
||||
if (r) return r;
|
||||
if (ch == '=') {
|
||||
ParseNonSpaceChar(p, &r, 0);
|
||||
if (r) return r;
|
||||
}
|
||||
|
||||
if (p->isnested) {
|
||||
|
||||
@@ -584,7 +584,7 @@ tail +2 ../tests/once.timestamp >> ../tests/test.out 2>&1
|
||||
rm -f ../tests/once.timestamp
|
||||
|
||||
# Newlines in calendar output
|
||||
(echo 'REM 16 MSG foo%_bar%_baz wookie quux apple %_ %_ %_ blech'; echo "REM 16 MSG ANOTHER") | ../src/remind -c -w80 - 1 sep 2024 >> ../tests/test.out 2>&1
|
||||
(echo 'REM 16 MSG foo%_bar%_baz wookie quux apple %_ %_ %_ blech'; echo "REM 16 MSG ANOTHER") | ../src/remind -c -w80 - 1 sep 1990 >> ../tests/test.out 2>&1
|
||||
|
||||
# Remove references to SysInclude, which is build-specific
|
||||
grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out
|
||||
|
||||
@@ -1029,7 +1029,7 @@ set a057 value("a05"+"6")
|
||||
"a05" + "6" => "a056"
|
||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a058 version()
|
||||
version() => "05.00.04"
|
||||
version() => "05.00.05"
|
||||
set a059 wkday(today())
|
||||
today() => 1991-02-16
|
||||
wkday(1991-02-16) => "Saturday"
|
||||
@@ -2619,7 +2619,7 @@ a086 4
|
||||
a109 2012-01-01
|
||||
a128 2018-02-03@16:45
|
||||
a039 "February"
|
||||
a058 "05.00.04"
|
||||
a058 "05.00.05"
|
||||
a077 "1992 92\n"
|
||||
a096 -4
|
||||
a119 -1
|
||||
@@ -5459,8 +5459,8 @@ SATSIFY ""
|
||||
REM SATISFY [version() > "01.00.00"]
|
||||
../tests/test.rem(1045): SATISFY: expression has no reference to trigdate() or $T...
|
||||
../tests/test.rem(1045): Trig = Saturday, 16 February, 1991
|
||||
version() => "05.00.04"
|
||||
"05.00.04" > "01.00.00" => 1
|
||||
version() => "05.00.05"
|
||||
"05.00.05" > "01.00.00" => 1
|
||||
../tests/test.rem(1045): Trig(satisfied) = Saturday, 16 February, 1991
|
||||
REM SATISFY [max(x, max(x, 1, 2, 3), 4, 5, 6) * 5]
|
||||
../tests/test.rem(1046): SATISFY: expression has no reference to trigdate() or $T...
|
||||
@@ -5681,8 +5681,12 @@ set xyz ! "0"
|
||||
|
||||
set zxk version(1)
|
||||
../tests/test.rem(1114): version: Too many arguments
|
||||
version(1)
|
||||
^-- here
|
||||
set zxk max()
|
||||
../tests/test.rem(1115): max: Not enough arguments
|
||||
max()
|
||||
^-- here
|
||||
|
||||
fset dooby(x) 1
|
||||
set zxk dooby()
|
||||
@@ -11848,7 +11852,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[0;30mBLACK[0m |[0;34mBLUE[0m |[0;32mGREEN[0m |[0;36mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[0;43m6 [0m|[0;45m7 [0m|[0;46m8 [0m|9 |10 |11 |
|
||||
|-@0 |[0;43m [0m|[0;45m [0m|[0;46m[0;30mBLACK[0m[0;46m [0m|[34;1mBRIGHT[0m |[32;1mBRIGHT[0m |[36;1mBRIGHT[0m |
|
||||
| |[0;43m [0m|[0;45m [0m|[0;46m [0m|[34;1mBLUE[0m |[32;1mGREEN[0m |[36;1mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -11870,7 +11874,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[30;1mBLACK[0m |[0;34mBLUE[0m |[0;32mGREEN[0m |[0;36mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[0;43m6 [0m|[0;45m7 [0m|[0;46m8 [0m|9 |10 |11 |
|
||||
|-@0,0 |[0;43m [0m|[0;45m [0m|[0;46m[0;30mBLACK[0m[0;46m [0m|[34;1mBRIGHT[0m |[32;1mBRIGHT[0m |[36;1mBRIGHT[0m |
|
||||
| |[0;43m [0m|[0;45m [0m|[0;46m [0m|[34;1mBLUE[0m |[32;1mGREEN[0m |[36;1mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -11892,7 +11896,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[0;30mBLACK[0m |[0;34mBLUE[0m |[0;32mGREEN[0m |[0;36mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[0;43m6 [0m|[0;45m7 [0m|[0;46m8 [0m|9 |10 |11 |
|
||||
|-@0,1 |[0;43m [0m|[0;45m [0m|[0;46m[0;30mBLACK[0m[0;46m [0m|[34;1mBRIGHT[0m |[32;1mBRIGHT[0m |[36;1mBRIGHT[0m |
|
||||
| |[0;43m [0m|[0;45m [0m|[0;46m [0m|[34;1mBLUE[0m |[32;1mGREEN[0m |[36;1mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -11914,7 +11918,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[38;5;0mBLACK[0m |[38;5;17mBLUE[0m |[38;5;22mGREEN[0m |[38;5;23mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[48;5;11m6 [0m|[48;5;13m7 [0m|[48;5;14m8 [0m|9 |10 |11 |
|
||||
|-@1 |[48;5;11m [0m|[48;5;13m [0m|[48;5;14m[38;5;0mBLACK[0m[48;5;14m [0m|[38;5;20mBRIGHT[0m |[38;5;40mBRIGHT[0m |[38;5;44mBRIGHT[0m |
|
||||
| |[48;5;11m [0m|[48;5;13m [0m|[48;5;14m [0m|[38;5;20mBLUE[0m |[38;5;40mGREEN[0m |[38;5;44mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -11936,7 +11940,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[38;5;238mBLACK[0m |[38;5;17mBLUE[0m |[38;5;22mGREEN[0m |[38;5;23mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[48;5;11m6 [0m|[48;5;13m7 [0m|[48;5;14m8 [0m|9 |10 |11 |
|
||||
|-@1,0 |[48;5;11m [0m|[48;5;13m [0m|[48;5;14m[38;5;0mBLACK[0m[48;5;14m [0m|[38;5;20mBRIGHT[0m |[38;5;40mBRIGHT[0m |[38;5;44mBRIGHT[0m |
|
||||
| |[48;5;11m [0m|[48;5;13m [0m|[48;5;14m [0m|[38;5;20mBLUE[0m |[38;5;40mGREEN[0m |[38;5;44mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -11958,7 +11962,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[38;5;0mBLACK[0m |[38;5;17mBLUE[0m |[38;5;22mGREEN[0m |[38;5;23mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[48;5;11m6 [0m|[48;5;13m7 [0m|[48;5;14m8 [0m|9 |10 |11 |
|
||||
|-@1,1 |[48;5;11m [0m|[48;5;13m [0m|[48;5;14m[38;5;0mBLACK[0m[48;5;14m [0m|[38;5;20mBRIGHT[0m |[38;5;40mBRIGHT[0m |[38;5;44mBRIGHT[0m |
|
||||
| |[48;5;11m [0m|[48;5;13m [0m|[48;5;14m [0m|[38;5;20mBLUE[0m |[38;5;40mGREEN[0m |[38;5;44mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -11980,7 +11984,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[38;2;0;0;0mBLACK[0m |[38;2;0;0;65mBLUE[0m |[38;2;0;65;0mGREEN[0m |[38;2;0;65;65mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[48;2;255;255;0m6 [0m|[48;2;255;0;255m7 [0m|[48;2;0;255;255m8 [0m|9 |10 |11 |
|
||||
|-@2 |[48;2;255;255;0m [0m|[48;2;255;0;255m [0m|[48;2;0;255;255m[38;2;0;0;0mBLACK[0m[48;2;0;255;255m [0m|[38;2;0;0;200mBRIGHT[0m |[38;2;0;200;0mBRIGHT[0m |[38;2;0;200;200mBRIGHT[0m |
|
||||
| |[48;2;255;255;0m [0m|[48;2;255;0;255m [0m|[48;2;0;255;255m [0m|[38;2;0;0;200mBLUE[0m |[38;2;0;200;0mGREEN[0m |[38;2;0;200;200mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -12002,7 +12006,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[38;2;65;65;65mBLACK[0m |[38;2;0;0;65mBLUE[0m |[38;2;0;65;0mGREEN[0m |[38;2;0;65;65mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[48;2;255;255;0m6 [0m|[48;2;255;0;255m7 [0m|[48;2;0;255;255m8 [0m|9 |10 |11 |
|
||||
|-@2,0 |[48;2;255;255;0m [0m|[48;2;255;0;255m [0m|[48;2;0;255;255m[38;2;0;0;0mBLACK[0m[48;2;0;255;255m [0m|[38;2;0;0;200mBRIGHT[0m |[38;2;0;200;0mBRIGHT[0m |[38;2;0;200;200mBRIGHT[0m |
|
||||
| |[48;2;255;255;0m [0m|[48;2;255;0;255m [0m|[48;2;0;255;255m [0m|[38;2;0;0;200mBLUE[0m |[38;2;0;200;0mGREEN[0m |[38;2;0;200;200mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -12024,7 +12028,7 @@ STDOUT is a: PIPE
|
||||
| | | |1 |2 |3 |4 |
|
||||
| | | |[38;2;0;0;0mBLACK[0m |[38;2;0;0;65mBLUE[0m |[38;2;0;65;0mGREEN[0m |[38;2;0;65;65mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|5 |6 |7 |8 |9 |10 |11 |
|
||||
|5 |[48;2;255;255;0m6 [0m|[48;2;255;0;255m7 [0m|[48;2;0;255;255m8 [0m|9 |10 |11 |
|
||||
|-@2,1 |[48;2;255;255;0m [0m|[48;2;255;0;255m [0m|[48;2;0;255;255m[38;2;0;0;0mBLACK[0m[48;2;0;255;255m [0m|[38;2;0;0;200mBRIGHT[0m |[38;2;0;200;0mBRIGHT[0m |[38;2;0;200;200mBRIGHT[0m |
|
||||
| |[48;2;255;255;0m [0m|[48;2;255;0;255m [0m|[48;2;0;255;255m [0m|[38;2;0;0;200mBLUE[0m |[38;2;0;200;0mGREEN[0m |[38;2;0;200;200mCYAN[0m |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
@@ -12592,7 +12596,7 @@ SECURITY: Won't read world-writable file or directory!
|
||||
Error reading include_dir/ww: Can't open file
|
||||
SECURITY: Won't read world-writable file or directory!
|
||||
Error reading include_dir/ww: No files matching *.rem
|
||||
05.00.04
|
||||
05.00.05
|
||||
NOTE JSONQUEUE
|
||||
[{"priority":2,"eventstart":"VOLATILE","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"VOLATILE","time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"VOLATILE","time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"VOLATILE","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}]
|
||||
NOTE ENDJSONQUEUE
|
||||
@@ -13176,11 +13180,11 @@ No reminders.
|
||||
# This is a timestamp file used by Remind to track ONCE reminders.
|
||||
# Do not edit or delete it.
|
||||
+----------------------------------------------------------------------------+
|
||||
| September 2024 |
|
||||
| September 1990 |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
| Sunday | Monday | Tuesday |Wednesday | Thursday | Friday | Saturday |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|1 |2 |3 |4 |5 |6 |7 |
|
||||
| | | | | | |1 |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
@@ -13188,7 +13192,7 @@ No reminders.
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|8 |9 |10 |11 |12 |13 |14 |
|
||||
|2 |3 |4 |5 |6 |7 |8 |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
@@ -13196,17 +13200,7 @@ No reminders.
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|15 |16 |17 |18 |19 |20 |21 |
|
||||
| | | | | | | |
|
||||
| |foo | | | | | |
|
||||
| |bar | | | | | |
|
||||
| |baz wookie| | | | | |
|
||||
| |quux apple| | | | | |
|
||||
| |blech | | | | | |
|
||||
| | | | | | | |
|
||||
| |ANOTHER | | | | | |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|22 |23 |24 |25 |26 |27 |28 |
|
||||
|9 |10 |11 |12 |13 |14 |15 |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
@@ -13214,7 +13208,25 @@ No reminders.
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|29 |30 | | | | | |
|
||||
|16 |17 |18 |19 |20 |21 |22 |
|
||||
| | | | | | | |
|
||||
|foo | | | | | | |
|
||||
|bar | | | | | | |
|
||||
|baz wookie| | | | | | |
|
||||
|quux apple| | | | | | |
|
||||
|blech | | | | | | |
|
||||
| | | | | | | |
|
||||
|ANOTHER | | | | | | |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|23 |24 |25 |26 |27 |28 |29 |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
+----------+----------+----------+----------+----------+----------+----------+
|
||||
|30 | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
| | | | | | | |
|
||||
|
||||
Reference in New Issue
Block a user