sed: remove YMAP_LENGTH

* sed/compile.c (YMAP_LENGTH): Remove.
All uses replaced by UCHAR_MAX + 1.
This commit is contained in:
Paul Eggert committed 2026-08-17 01:17:23 -07:00
1 parent 0e9c603e82
commit f0e2d07924
1 file changed
+2 -4
+2 -4
View File
@@ -27,8 +27,6 @@
#include "progname.h"
#include "xalloc.h"
#define YMAP_LENGTH 256 /*XXX shouldn't this be (UCHAR_MAX+1)?*/
/* let's not confuse text editors that have only dumb bracket-matching... */
#define OPEN_BRACKET '['
#define CLOSE_BRACKET ']'
@@ -1261,13 +1259,13 @@ compile_program (struct vector *vector)
else
{
unsigned char *translate =
OB_MALLOC (&obs, YMAP_LENGTH, unsigned char);
OB_MALLOC (&obs, UCHAR_MAX + 1, unsigned char);
unsigned char *ustring = (unsigned char *)src_buf;
if (len != dest_len)
bad_prog ("'y' command strings have different lengths");
for (len = 0; len < YMAP_LENGTH; len++)
for (len = 0; len < UCHAR_MAX + 1; len++)
translate[len] = len;
while (dest_len--)