From owner-freebsd-ports Sun Nov 1 20:30:02 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA01001 for freebsd-ports-outgoing; Sun, 1 Nov 1998 20:30:02 -0800 (PST) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA00965 for ; Sun, 1 Nov 1998 20:29:59 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id UAA07441; Sun, 1 Nov 1998 20:30:01 -0800 (PST) Date: Sun, 1 Nov 1998 20:30:01 -0800 (PST) Message-Id: <199811020430.UAA07441@freefall.freebsd.org> To: freebsd-ports@FreeBSD.ORG From: "Pedro F. Giffuni" Subject: Re: ports/8530: Update to the kawk port Reply-To: "Pedro F. Giffuni" Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR ports/8530; it has been noted by GNATS. From: "Pedro F. Giffuni" To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: ports/8530: Update to the kawk port Date: Sun, 01 Nov 1998 23:21:33 -0500 It would also be good to include this patch, part of James Raynard fixes (I called it patch-ba on my system) ____cut here___ *** b.c.orig Sun Nov 1 17:14:22 1998 --- b.c Sun Nov 1 17:23:00 1998 *************** *** 27,32 **** --- 27,35 ---- #define DEBUG #include + #ifdef __FreeBSD__ + #include + #endif #include #include #include *************** *** 74,79 **** --- 77,100 ---- fa *fatab[NFA]; int nfatab = 0; /* entries in fatab */ + #ifdef __FreeBSD__ + static int + collate_range_cmp(a, b) + int a, b; + { + 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; + } + #endif + fa *makedfa(char *s, int anchor) /* returns dfa for reg expr s */ { int i, use, nuse; *************** *** 284,289 **** --- 305,313 ---- char *cclenter(char *p) /* add a character class */ { int i, c, c2; + #ifdef __FreeBSD__ + int c3; + #endif char *op, *bp; static char *buf = 0; static int bufsz = 100; *************** *** 301,306 **** --- 325,347 ---- c2 = *p++; if (c2 == '\\') c2 = quoted(&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)) + ERROR "out of space for character class [%.10s...] 2", p FATAL; + *bp++ = c3 + 1; + i++; + } + } + #else + if (c > c2) { /* empty; ignore */ if (c > c2) { /* empty; ignore */ bp--; i--; *************** *** 312,317 **** --- 353,359 ---- *bp++ = ++c; i++; } + #endif continue; } } *** main.c.orig Sun Nov 1 17:24:32 1998 --- main.c Sun Nov 1 17:28:40 1998 *************** *** 27,38 **** --- 27,43 ---- #define DEBUG #include #include + #include #include #include #include #include "awk.h" #include "ytab.h" + #ifdef __FreeBSD__ + # include + #endif + extern char **environ; extern int nfields; *************** *** 55,66 **** char *fs = NULL, *marg; int temp; ! cmdname = argv[0]; if (argc == 1) { fprintf(stderr, "Usage: %s [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]\n", cmdname); exit(1); } signal(SIGFPE, fpecatch); yyin = NULL; symtab = makesymtab(NSYMTAB); while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') { --- 60,80 ---- char *fs = NULL, *marg; int temp; ! setlocale(LC_ALL, ""); ! ! if ((cmdname = strrchr(argv[0], '/')) != NULL) ! cmdname++; ! else ! cmdname = argv[0]; if (argc == 1) { fprintf(stderr, "Usage: %s [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]\n", cmdname); exit(1); } signal(SIGFPE, fpecatch); + #ifdef __FreeBSD__ + fpsetround(FP_RN); + fpsetmask(0L); + #endif yyin = NULL; symtab = makesymtab(NSYMTAB); while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message