[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/src/Attic/builtin.c,v [branch-1_4]
From: |
Eric Blake |
Subject: |
Changes to m4/src/Attic/builtin.c,v [branch-1_4] |
Date: |
Thu, 24 Aug 2006 14:27:35 +0000 |
CVSROOT: /sources/m4
Module name: m4
Branch: branch-1_4
Changes by: Eric Blake <ericb> 06/08/24 14:27:33
Index: src/builtin.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/builtin.c,v
retrieving revision 1.1.1.1.2.36
retrieving revision 1.1.1.1.2.37
diff -u -b -r1.1.1.1.2.36 -r1.1.1.1.2.37
--- src/builtin.c 18 Aug 2006 23:11:36 -0000 1.1.1.1.2.36
+++ src/builtin.c 24 Aug 2006 14:27:33 -0000 1.1.1.1.2.37
@@ -1475,7 +1475,12 @@
int l1, l2, retval;
if (bad_argc (argv[0], argc, 3, 3))
+ {
+ /* builtin(`index') is blank, but index(`abc') is 0. */
+ if (argc == 2)
+ shipout_int (obs, 0);
return;
+ }
l1 = strlen (ARG (1));
l2 = strlen (ARG (2));
@@ -1506,7 +1511,12 @@
int length, avail;
if (bad_argc (argv[0], argc, 3, 4))
+ {
+ /* builtin(`substr') is blank, but substr(`abc') is abc. */
+ if (argc == 2)
+ obstack_grow (obs, ARG (1), strlen (ARG (1)));
return;
+ }
length = avail = strlen (ARG (1));
if (!numeric_arg (argv[0], ARG (2), &start))
@@ -1584,7 +1594,12 @@
int tolen;
if (bad_argc (argv[0], argc, 3, 4))
+ {
+ /* builtin(`translit') is blank, but translit(`abc') is abc. */
+ if (argc == 2)
+ obstack_grow (obs, ARG (1), strlen (ARG (1)));
return;
+ }
from = ARG (2);
if (strchr (from, '-') != NULL)
@@ -1750,7 +1765,12 @@
int length; /* length of first argument */
if (bad_argc (argv[0], argc, 3, 4))
+ {
+ /* builtin(`regexp') is blank, but regexp(`abc') is 0. */
+ if (argc == 2)
+ shipout_int (obs, 0);
return;
+ }
victim = TOKEN_DATA_TEXT (argv[1]);
regexp = TOKEN_DATA_TEXT (argv[2]);
@@ -1806,7 +1826,12 @@
int length; /* length of first argument */
if (bad_argc (argv[0], argc, 3, 4))
+ {
+ /* builtin(`patsubst') is blank, but patsubst(`abc') is abc. */
+ if (argc == 2)
+ obstack_grow (obs, ARG (1), strlen (ARG (1)));
return;
+ }
regexp = TOKEN_DATA_TEXT (argv[2]);
@@ -1826,7 +1851,7 @@
offset = 0;
matchpos = 0;
- while (offset < length)
+ while (offset <= length)
{
matchpos = re_search (&buf, victim, length,
offset, length - offset, ®s);
- Changes to m4/src/Attic/builtin.c,v [branch-1_4], Eric Blake, 2006/08/04
- Changes to m4/src/Attic/builtin.c,v [branch-1_4], Eric Blake, 2006/08/15
- Changes to m4/src/Attic/builtin.c,v [branch-1_4], Eric Blake, 2006/08/16
- Changes to m4/src/Attic/builtin.c,v [branch-1_4], Eric Blake, 2006/08/17
- Changes to m4/src/Attic/builtin.c,v [branch-1_4], Eric Blake, 2006/08/18
- Changes to m4/src/Attic/builtin.c,v [branch-1_4], Eric Blake, 2006/08/18
- Changes to m4/src/Attic/builtin.c,v [branch-1_4],
Eric Blake <=