From 1282efa657de5948941ddaf458fc06aa6882dd47 Mon Sep 17 00:00:00 2001 From: tnn Date: Sat, 21 Feb 2009 20:06:30 +0000 Subject: Merge the following revisions from NetBSD src: c_ulimit.c 1.9: avoid sign extension problem lex.c 1.13: bugfix related to nested quotes Bump PKGREVISION. --- shells/pdksh/Makefile | 4 ++-- shells/pdksh/files/c_ulimit.c | 4 ++-- shells/pdksh/files/lex.c | 50 ++++++++++++++++--------------------------- 3 files changed, 22 insertions(+), 36 deletions(-) (limited to 'shells') diff --git a/shells/pdksh/Makefile b/shells/pdksh/Makefile index 9054989cc9b..01378265cbc 100644 --- a/shells/pdksh/Makefile +++ b/shells/pdksh/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.17 2008/06/19 18:36:51 joerg Exp $ +# $NetBSD: Makefile,v 1.18 2009/02/21 20:06:30 tnn Exp $ # DISTNAME= pdksh-5.2.14 -PKGREVISION= 3 +PKGREVISION= 4 CATEGORIES= shells MASTER_SITES= ftp://ftp.cs.mun.ca/pub/pdksh/ \ http://gd.tuwien.ac.at/utils/shells/pdksh/ \ diff --git a/shells/pdksh/files/c_ulimit.c b/shells/pdksh/files/c_ulimit.c index 004982f1f53..3f7282b4530 100644 --- a/shells/pdksh/files/c_ulimit.c +++ b/shells/pdksh/files/c_ulimit.c @@ -1,4 +1,4 @@ -/* $NetBSD: c_ulimit.c,v 1.3 2008/06/15 14:20:08 tnn Exp $ */ +/* $NetBSD: c_ulimit.c,v 1.4 2009/02/21 20:06:30 tnn Exp $ */ /* ulimit -- handle "ulimit" builtin @@ -187,7 +187,7 @@ c_ulimit(wp) bi_errorf("invalid limit: %s", wp[0]); return 1; } - val = rval * l->factor; + val = (unsigned long)rval * l->factor; } } if (all) { diff --git a/shells/pdksh/files/lex.c b/shells/pdksh/files/lex.c index 2ec5018f7f3..502f0662574 100644 --- a/shells/pdksh/files/lex.c +++ b/shells/pdksh/files/lex.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.3 2008/06/15 14:20:09 tnn Exp $ */ +/* $NetBSD: lex.c,v 1.4 2009/02/21 20:06:30 tnn Exp $ */ /* * lexical analysis and source input @@ -328,41 +328,27 @@ yylex(cf) *wp++ = COMSUB; /* Need to know if we are inside double quotes * since sh/at&t-ksh translate the \" to " in - * "`..\"..`". - * This is not done in posix mode (section - * 3.2.3, Double Quotes: "The backquote shall - * retain its special meaning introducing the - * other form of command substitution (see - * 3.6.3). The portion of the quoted string - * from the initial backquote and the - * characters up to the next backquote that - * is not preceded by a backslash (having - * escape characters removed) defines that - * command whose output replaces `...` when - * the word is expanded." - * Section 3.6.3, Command Substitution: - * "Within the backquoted style of command - * substitution, backslash shall retain its - * literal meaning, except when followed by - * $ ` \."). + * "`..\"..`". POSIX also requires this. + * An earlier version of ksh misinterpreted + * the POSIX specification and performed + * removal of backslash escapes only if + * posix mode was not in effect. */ statep->ls_sbquote.indquotes = 0; - if (!Flag(FPOSIX)) { - Lex_state *s = statep; - Lex_state *base = state_info.base; - while (1) { - for (; s != base; s--) { - if (s->ls_state == SDQUOTE) { - statep->ls_sbquote.indquotes = 1; - break; - } - } - if (s != base) - break; - if (!(s = s->ls_info.base)) + Lex_state *s = statep; + Lex_state *base = state_info.base; + while (1) { + for (; s != base; s--) { + if (s->ls_state == SDQUOTE) { + statep->ls_sbquote.indquotes = 1; break; - base = s-- - STATE_BSIZE; + } } + if (s != base) + break; + if (!(s = s->ls_info.base)) + break; + base = s-- - STATE_BSIZE; } break; default: -- cgit v1.2.3