Date: Sat, 19 Oct 2002 14:45:29 -0700 (PDT) From: "Steven G. Kargl" <kargl@troutmask.apl.washington.edu> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/44281: Fix build of lang/nawk Message-ID: <200210192145.g9JLjT74077080@troutmask.apl.washington.edu>
next in thread | raw e-mail | index | archive | help
>Number: 44281 >Category: ports >Synopsis: Fix build of lang/nawk >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 19 14:50:03 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Steven G. Kargl >Release: FreeBSD 5.0-CURRENT i386 >Organization: apl/uw >Environment: System: FreeBSD troutmask.apl.washington.edu 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Sep 4 12:10:46 PDT 2002 kargl@troutmask.apl.washington.edu:/usr/obj/usr/src/sys/TROUTMASK i386 >Description: Fix the build of lang/nawk on -current. >How-To-Repeat: cd lang/nawk ; make >Fix: diff -ur nawk.orig/distinfo nawk/distinfo --- nawk.orig/distinfo Fri Mar 15 18:56:57 2002 +++ nawk/distinfo Sat Oct 19 14:26:41 2002 @@ -1 +1 @@ -MD5 (awk.tar.gz) = 65f0afae31a1ed77dd21de5a15be570d +MD5 (awk.tar.gz) = 1e2ef4bce7e538c8bf513ac21120bb26 diff -ur nawk.orig/files/patch-ba nawk/files/patch-ba --- nawk.orig/files/patch-ba Fri Nov 3 12:24:42 2000 +++ nawk/files/patch-ba Sat Oct 19 14:41:24 2002 @@ -1,10 +1,10 @@ ---- b.c.orig Sun Sep 24 17:18:38 2000 -+++ b.c Fri Nov 3 01:59:32 2000 +--- b.c.orig Sat Oct 19 14:29:49 2002 ++++ b.c Sat Oct 19 14:38:33 2002 @@ -27,6 +27,9 @@ #define DEBUG #include <ctype.h> -+#ifdef __FreeBSD__ ++#ifdef __FreeBSD__ +#include <limits.h> +#endif #include <stdio.h> @@ -14,65 +14,66 @@ fa *fatab[NFA]; int nfatab = 0; /* entries in fatab */ -+#ifdef __FreeBSD__ ++#ifdef __FreeBSD__ +static int +collate_range_cmp(a, b) +int a, b; +{ -+ int r; -+ static char s[2][2]; ++ int r; ++ static char s[2][2]; + -+ if ((unsigned char)a == (unsigned char)b) -+ return 0; -+ s[0][0] = a; -+ s[1][0] = b; -+ if ((r = strcoll(s[0], s[1])) == 0) -+ r = (unsigned char)a - (unsigned char)b; -+ return r; ++ if ((unsigned char)a == (unsigned char)b) ++ return 0; ++ s[0][0] = a; ++ s[1][0] = b; ++ if ((r = strcoll(s[0], s[1])) == 0) ++ r = (unsigned char)a - (unsigned char)b; ++ return r; +} +#endif + - fa *makedfa(char *s, int anchor) /* returns dfa for reg expr s */ + fa *makedfa(const char *s, int anchor) /* returns dfa for reg expr s */ { int i, use, nuse; @@ -287,6 +308,9 @@ int i, c, c2; uschar *p = (uschar *) argp; uschar *op, *bp; -+#ifdef __FreeBSD__ -+ int c3; ++#ifdef __FreeBSD__ ++ int c3; +#endif static uschar *buf = 0; static int bufsz = 100; -@@ -303,6 +327,22 @@ +@@ -303,6 +327,23 @@ c2 = *p++; if (c2 == '\\') c2 = quoted((char **) &p); -+#ifdef __FreeBSD__ -+ if (collate_range_cmp(c, c2) > 0) { -+ bp--; -+ i--; -+ continue; -+ } -+ for (c3 = 0; c3 < (1 << CHAR_BIT) - 1; c3++) { -+ if (collate_range_cmp(c, c3) <= 0 && -+ collate_range_cmp(c3, c2) <= 0) { -+ if (!adjbuf(&buf, &bufsz, bp-buf+2, 100, &bp, 0)) -+ FATAL("out of space for character class [%.10s...] 2", p); -+ *bp++ = c3 + 1; -+ i++; -+ } -+ } ++#ifdef __FreeBSD__ ++ if (collate_range_cmp(c, c2) > 0) { ++ bp--; ++ i--; ++ continue; ++ } ++ for (c3 = 0; c3 < (1 << CHAR_BIT) - 1; c3++) { ++ if (collate_range_cmp(c, c3) <= 0 && ++ collate_range_cmp(c3, c2) <= 0) { ++ if (!adjbuf(&buf, &bufsz, bp-buf+2, 100, &bp, 0)) ++ FATAL("out of space for character class [%.10s...] 2", p); ++ *bp++ = c3 + 1; ++ i++; ++ } ++ } +#else /*FreeBSD*/ ++ if (c > c2) { /* empty; ignore */ bp--; i--; -@@ -314,6 +354,7 @@ +@@ -314,6 +355,7 @@ *bp++ = ++c; i++; } -+#endif /*FreeBSD*/ ++#endif /*FreeBSD*/ continue; } } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210192145.g9JLjT74077080>