diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2009-10-28 10:36:39 -0700 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2009-10-28 10:36:39 -0700 |
commit | 34f9b3eef6fdadbda0a846aa4d68691ac40eace5 (patch) | |
tree | 0b0fdfb35f8eb9324728de5a99e50e939aca650f /usr/src/lib/libpp/common | |
parent | 14969419acb89bb74e6c95fa472119b710224440 (diff) | |
download | illumos-joyent-34f9b3eef6fdadbda0a846aa4d68691ac40eace5.tar.gz |
Portions contributed by Olga Kryzhanovska <olga.kryzhanovska@gmail.com>
PSARC/2009/063 ksh93 update 2
PSARC/2009/248 ksh93 update to 2009-03-10
PSARC/2009/249 more ksh93 command conversions
6888396 libast sources should not include localedef.h
6605478 ksh93 profile shell option does not work
6631006 ksh93 hangs in situations that ksh handles okay
6661487 logname reports nothing after running the script command
6705126 first call to read doesn't honor new setting of HISTFILE
6764665 *libpp* Array overrun in libpp
6765756 *libast* Array overruns in libast
6769332 Recursive function+command substitutions terminate shell after 257 iterations
6777491 *ksh93* lacks arithmetric function iszero()
6778077 *ksh93* does not understand "THAW" as a signal for use with trap
6789247 [ku1] libast/ksh93 1-digit hexfloat base conversion rounds incorrectly
6791838 *ksh93* unset of a variable which is not set should return 0
6793714 RFE: Update /usr/bin/comm to AT&T AST "comm"
6793719 RFE: Update /usr/bin/cut to AT&T AST "cut"
6793721 RFE: Update /usr/bin/paste to AT&T AST "paste"
6793722 RFE: Update /usr/bin/cmp to AT&T AST "cmp"
6793726 RFE: Update /usr/bin/uniq to AT&T AST "uniq"
6793735 RFE: Update /usr/bin/wc to AT&T AST "wc"
6793744 RFE: Add /usr/share/doc/ksh/ for ksh93 documentation
6793747 RFE: Provide "print" builtin as /usr/bin/print for external applications
6793763 RFE: Update /usr/bin/ksh93 to ast-ksh.2009-05-05
6794952 RFE: Enable "globstar" mode in /etc/ksh.kshrc (= interactive ksh93 shells)
6805792 [ku1] Moving local compound var into array does not work
6805794 [ku1] printf returns "invalid character constant" for $ printf "%d\n" "'<euro>"
6805795 [ku1] ksh93 does not differ between -0 and +0
6805797 [ku1]Can't append to nodes of an array of compound vars if addressing them via nameref
6805799 Indexed compound variable arrays do not work...
6805800 [ku1] Declaring associative compound array does not work
6805813 RFE: Update /usr/bin/join to AT&T AST "join".
6805819 RFE: Update /usr/bin/tee to AT&T AST "tee".
6809663 shlint missing ending newline on errors
6811916 ksh93 repeatedly segfaults when "tee" builtin is interrupted via <ctrl-c> in interactive mode
6821113 SUNWosdem package issues
6828644 RFE: Update /usr/bin/logname to AT&T AST "logname".
6828692 RFE: Update /usr/bin/cksum to AT&T AST "cksum".
6834184 ksh93 gets SIGSEGV if HISTFILE is changed in place.
6834207 ksh93 gets SIGSEGV on interactive function definition with HISTSIZE unset
6835835 ksh93 "cat" builtin does not handle "-n" correctly
6841442 Need exception list for OS/Net trees managed via Subversion
6848486 "echo ${test}" with test undefined crashes the shell
6850672 ksh93 (VISUAL=vi) crashes with memory fault while scrolling through history
6855875 typeset -X x ; print $x # does not print sufficient digits to restore value
6857344 /usr/bin/hash core dump with invalid arguments
6866676 Need test suite module to test the kernel support for compiled shell scripts
6881017 Subshell doesn't exit, holds pipe open preventing callers from exiting
6884409 fts functions in libast library can result in segv with deep dir trees (similar to CERT VU#590371)
Diffstat (limited to 'usr/src/lib/libpp/common')
32 files changed, 110 insertions, 74 deletions
diff --git a/usr/src/lib/libpp/common/RELEASE b/usr/src/lib/libpp/common/RELEASE index 80a3c89a48..0e09f6089d 100644 --- a/usr/src/lib/libpp/common/RELEASE +++ b/usr/src/lib/libpp/common/RELEASE @@ -1,3 +1,12 @@ +09-02-02 pp.probe,probe.win32: check for compiler supplied __FUNCTION__ +09-02-02 ppop.c: include pp_default.h/probe at end of builtin script +09-01-20 probe.win32: elide #pragma comment.*linker.*manifest +09-01-06 ppcall.c: fix macro definition overwrite bug -- I know +09-01-05 ppcontrol.c: fix multiple include guard for #include outside guard +08-12-07 pp.h,ppdata.c: fix ancient pptype and ppctype[] off by one +08-11-15 ppsearch.c: '\\' => '/' in first step; msvc complains about '\\' in #line!! +08-10-31 ppsearch.c: relax pp:nomultiple pedantry +08-10-30 pplex.c: handle =#x S_CHRB|SPLICE bug 08-05-11 ppproto.c: fix proto test 10 regression 07-09-21 ppproto.c: add "Public Domain" to the noticed list 07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING] diff --git a/usr/src/lib/libpp/common/gentab.sh b/usr/src/lib/libpp/common/gentab.sh index d843868970..5000d3ab90 100644 --- a/usr/src/lib/libpp/common/gentab.sh +++ b/usr/src/lib/libpp/common/gentab.sh @@ -1,7 +1,7 @@ ######################################################################## # # # This software is part of the ast package # -# Copyright (c) 1986-2008 AT&T Intellectual Property # +# Copyright (c) 1986-2009 AT&T Intellectual Property # # and is licensed under the # # Common Public License, Version 1.0 # # by AT&T Intellectual Property # diff --git a/usr/src/lib/libpp/common/pp.h b/usr/src/lib/libpp/common/pp.h index 08eee17b16..c8c30ae074 100644 --- a/usr/src/lib/libpp/common/pp.h +++ b/usr/src/lib/libpp/common/pp.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -82,7 +82,7 @@ #define ppsymset(t,n) (struct ppsymbol*)hashlook(t,n,HASH_CREATE|HASH_SIZE(sizeof(struct ppsymbol)),NiL) #if CHAR_MIN < 0 -#define pptype (ppctype-(CHAR_MIN)+1) +#define pptype (ppctype-(CHAR_MIN)) #else #define pptype (ppctype) #endif diff --git a/usr/src/lib/libpp/common/pp.probe b/usr/src/lib/libpp/common/pp.probe index 285f23da71..5d18c26eda 100644 --- a/usr/src/lib/libpp/common/pp.probe +++ b/usr/src/lib/libpp/common/pp.probe @@ -2,7 +2,7 @@ # Glenn Fowler # AT&T Research # -# @(#)pp.probe (AT&T Research) 2006-09-05 +# @(#)pp.probe (AT&T Research) 2009-02-02 # # C probe for libpp # @@ -25,6 +25,7 @@ architecture= cpu= model= machine= +undef_predef= # # path cleanup @@ -575,6 +576,13 @@ do echo "#include <sys/$i.h>" > t.$src eval sys_$i=$x done +echo "char* fun() { return (char*)__FUNCTION__; } +int main() { return !fun(); }" > fun.$src +rm -f fun.exe +if $cc -o fun.exe fun.$src && test -x fun.exe +then undef_predef="$undef_predef __FUNCTION__" +fi + case "`grep -c '__STDC__[-0 ]*[=!]=[ ]*0' $usrinclude/stdio.h 2>/dev/null`" in 0) ;; *) hostedtransition=1 ;; @@ -1033,6 +1041,13 @@ case $so:$dynamic:$static in *) echo "#define #dialect(dynamic)" ;; esac echo +case $undef_predef in +?*) for m in $undef_predef + do echo "#undef $m" + done + echo + ;; +esac case $plusplus in ?*) echo "#pragma pp:plusplus" ;; esac diff --git a/usr/src/lib/libpp/common/ppargs.c b/usr/src/lib/libpp/common/ppargs.c index 52da340da3..567b216512 100644 --- a/usr/src/lib/libpp/common/ppargs.c +++ b/usr/src/lib/libpp/common/ppargs.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -27,7 +27,7 @@ */ static const char usage[] = -"[-?\n@(#)$Id: cpp (AT&T Research) 2007-03-11 $\n]" +"[-?\n@(#)$Id: cpp (AT&T Research) 2009-02-02 $\n]" USAGE_LICENSE "[+NAME?cpp - C language preprocessor]" "[+DESCRIPTION?\bcpp\b is the preprocessor for all C language dialects. It is" diff --git a/usr/src/lib/libpp/common/ppbuiltin.c b/usr/src/lib/libpp/common/ppbuiltin.c index 4e58af0251..e33d2641d4 100644 --- a/usr/src/lib/libpp/common/ppbuiltin.c +++ b/usr/src/lib/libpp/common/ppbuiltin.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppcall.c b/usr/src/lib/libpp/common/ppcall.c index b06a5961f9..2c18530e6e 100644 --- a/usr/src/lib/libpp/common/ppcall.c +++ b/usr/src/lib/libpp/common/ppcall.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -51,6 +51,7 @@ ppcall(register struct ppsymbol* sym, int tok) int last_line; long old_state; char* last_file; + char* old_next; char* old_token; struct ppmacstk* mp; struct ppinstk* old_in; @@ -183,6 +184,7 @@ ppcall(register struct ppsymbol* sym, int tok) for (p = pp.in->nextchr; isspace(*p); p++); if ((c = *p) != '(' && c != '/' && c != 0 && c != MARK) goto disable; + old_next = (c == MARK) ? pp.in->nextchr : NiL; old_token = pp.token; mp = pp.macp->next; if ((pp.token = (char*)&mp->arg[mac->arity + 1]) > pp.maxmac) @@ -200,24 +202,29 @@ ppcall(register struct ppsymbol* sym, int tok) if (c != '(') { pp.state = old_state; - if (c) + if (old_next) + pp.in->nextchr = old_next; + else { - p = pp.toknxt; - while (p > pp.token) - ungetchr(*--p); + if (c) + { + p = pp.toknxt; + while (p > pp.token) + ungetchr(*--p); #if COMPATIBLE - if ((pp.state & (COMPATIBILITY|STRICT)) == (COMPATIBILITY|STRICT)) - error(1, "%s: macro arguments omitted", sym->name); + if ((pp.state & (COMPATIBILITY|STRICT)) == (COMPATIBILITY|STRICT)) + error(1, "%s: macro arguments omitted", sym->name); #endif - if (c == T_ID && !(pp.state & HIDDEN)) - ungetchr(' '); - } - if (pp.hidden != old_hidden) - { - ungetchr('\n'); - error_info.line--; - if (pp.hidden && !--pp.hidden) - pp.state &= ~HIDDEN; + if (c == T_ID && !(pp.state & HIDDEN)) + ungetchr(' '); + } + if (pp.hidden != old_hidden) + { + ungetchr('\n'); + error_info.line--; + if (pp.hidden && !--pp.hidden) + pp.state &= ~HIDDEN; + } } pp.token = old_token; goto disable; diff --git a/usr/src/lib/libpp/common/ppcomment.c b/usr/src/lib/libpp/common/ppcomment.c index 75e5f1e843..8099e46dac 100644 --- a/usr/src/lib/libpp/common/ppcomment.c +++ b/usr/src/lib/libpp/common/ppcomment.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppcontext.c b/usr/src/lib/libpp/common/ppcontext.c index 7bba261a5f..f87a2fff33 100644 --- a/usr/src/lib/libpp/common/ppcontext.c +++ b/usr/src/lib/libpp/common/ppcontext.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppcontrol.c b/usr/src/lib/libpp/common/ppcontrol.c index fff96641f3..10fb841965 100644 --- a/usr/src/lib/libpp/common/ppcontrol.c +++ b/usr/src/lib/libpp/common/ppcontrol.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -450,6 +450,7 @@ ppcontrol(void) } pp.state &= ~DISABLE; pp.state |= HEADER|STRIP; + pp.in->flags |= IN_noguard; switch (c = pplex()) { case T_STRING: @@ -1468,11 +1469,12 @@ ppcontrol(void) { case T_STRING: s = error_info.file; - if (*(p = pp.token)) pathcanon(p, 0); + if (*(p = pp.token)) + pathcanon(p, 0); fp = ppsetfile(p); error_info.file = fp->name; if (error_info.line == 1) - ppmultiple(fp, INC_TEST); + ppmultiple(fp, INC_IGNORE); switch (c = pplex()) { case '\n': @@ -1953,8 +1955,8 @@ ppcontrol(void) break; case X_MULTIPLE: n = 1; - if (pp.in->type == IN_FILE) - ppmultiple(ppsetfile(error_info.file), i0 ? INC_CLEAR : INC_TEST); + if (pp.in->type == IN_FILE || pp.in->type == IN_RESCAN) + ppmultiple(ppsetfile(error_info.file), i0 ? INC_CLEAR : INC_IGNORE); break; case X_NATIVE: setoption(NATIVE, i0); diff --git a/usr/src/lib/libpp/common/ppcpp.c b/usr/src/lib/libpp/common/ppcpp.c index e9bdae545a..a886799950 100644 --- a/usr/src/lib/libpp/common/ppcpp.c +++ b/usr/src/lib/libpp/common/ppcpp.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppdata.c b/usr/src/lib/libpp/common/ppdata.c index 555773e334..f06f64feb7 100644 --- a/usr/src/lib/libpp/common/ppdata.c +++ b/usr/src/lib/libpp/common/ppdata.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -48,7 +48,7 @@ * only within macro bodies */ -static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2007-06-12 $\0\n"; +static const char id[] = "\n@(#)$Id: libpp (AT&T Research) 2009-02-02 $\0\n"; #include "pplib.h" @@ -176,4 +176,4 @@ struct ppglobals pp = /* the rest are implicitly initialized */ }; -char ppctype[UCHAR_MAX]; +char ppctype[UCHAR_MAX+1]; diff --git a/usr/src/lib/libpp/common/pperror.c b/usr/src/lib/libpp/common/pperror.c index e7f575a908..531a08a57d 100644 --- a/usr/src/lib/libpp/common/pperror.c +++ b/usr/src/lib/libpp/common/pperror.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppexpr.c b/usr/src/lib/libpp/common/ppexpr.c index 219b707cb5..225034b97d 100644 --- a/usr/src/lib/libpp/common/ppexpr.c +++ b/usr/src/lib/libpp/common/ppexpr.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppfsm.c b/usr/src/lib/libpp/common/ppfsm.c index 42a7f4ef1a..05b28a64ef 100644 --- a/usr/src/lib/libpp/common/ppfsm.c +++ b/usr/src/lib/libpp/common/ppfsm.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppfsm.h b/usr/src/lib/libpp/common/ppfsm.h index ac471e0e80..4640bcebc2 100644 --- a/usr/src/lib/libpp/common/ppfsm.h +++ b/usr/src/lib/libpp/common/ppfsm.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppincref.c b/usr/src/lib/libpp/common/ppincref.c index 5d4362cb9d..6080d3ed54 100644 --- a/usr/src/lib/libpp/common/ppincref.c +++ b/usr/src/lib/libpp/common/ppincref.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppinput.c b/usr/src/lib/libpp/common/ppinput.c index 0fac34d9e1..b940fa9fe9 100644 --- a/usr/src/lib/libpp/common/ppinput.c +++ b/usr/src/lib/libpp/common/ppinput.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppkey.c b/usr/src/lib/libpp/common/ppkey.c index 8bb10531fd..6953a01908 100644 --- a/usr/src/lib/libpp/common/ppkey.c +++ b/usr/src/lib/libpp/common/ppkey.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppkey.h b/usr/src/lib/libpp/common/ppkey.h index d87543fed2..6c8515fe8f 100644 --- a/usr/src/lib/libpp/common/ppkey.h +++ b/usr/src/lib/libpp/common/ppkey.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/pplex.c b/usr/src/lib/libpp/common/pplex.c index a421393b60..4fd2bbae0b 100644 --- a/usr/src/lib/libpp/common/pplex.c +++ b/usr/src/lib/libpp/common/pplex.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -2036,7 +2036,7 @@ ppcpp(void) SYNCIN(); PUSH_QUOTE(pp.macp->arg[c - ARGOFFSET], pp.macp->line); CACHEIN(); - bp = ip - 1; + *(bp = ip - 1) = '"'; if (st & (COLLECTING|EOF2NL|JOINING)) rp = fsm[START]; if (state = rp[c = '"']) goto fsm_next; goto fsm_get; diff --git a/usr/src/lib/libpp/common/pplib.h b/usr/src/lib/libpp/common/pplib.h index a450eb63a9..5738078f3a 100644 --- a/usr/src/lib/libpp/common/pplib.h +++ b/usr/src/lib/libpp/common/pplib.h @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppline.c b/usr/src/lib/libpp/common/ppline.c index 62e56c3a73..5bd0014bde 100644 --- a/usr/src/lib/libpp/common/ppline.c +++ b/usr/src/lib/libpp/common/ppline.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppmacref.c b/usr/src/lib/libpp/common/ppmacref.c index efe97e63ce..4b54d66bd0 100644 --- a/usr/src/lib/libpp/common/ppmacref.c +++ b/usr/src/lib/libpp/common/ppmacref.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppmisc.c b/usr/src/lib/libpp/common/ppmisc.c index 22a989ada4..f4dea77f5c 100644 --- a/usr/src/lib/libpp/common/ppmisc.c +++ b/usr/src/lib/libpp/common/ppmisc.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppop.c b/usr/src/lib/libpp/common/ppop.c index 61f9983469..16c0260cd2 100644 --- a/usr/src/lib/libpp/common/ppop.c +++ b/usr/src/lib/libpp/common/ppop.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -841,8 +841,6 @@ ppop(int op, ...) if (!(pp.ppdefault = pathprobe(pp.path, NiL, "C", pp.pass, pp.probe ? pp.probe : PPPROBE, 0))) error(1, "cannot determine default definitions for %s", pp.probe ? pp.probe : PPPROBE); } - if (pp.ppdefault) - sfprintf(sp, "#%s \"%s\"\n", dirname(INCLUDE), pp.ppdefault); if (pp.probe) pp.lastdir->next->type = c; } @@ -908,9 +906,6 @@ ppop(int op, ...) ); sfprintf(sp, "\ -#%s __STDC__\n\ -#%s __STDC__ #(STDC)\n\ -#%s\n\ #%s #%s(%s)\n\ #%s %s:%s\n\ #%s %s:%s\n\ @@ -918,9 +913,6 @@ ppop(int op, ...) #%s\n\ #%s\n\ " - , dirname(IFNDEF) - , dirname(DEFINE) - , dirname(ENDIF) , dirname(IF) , keyname(X_OPTION) , keyname(X_STRICT) @@ -978,6 +970,18 @@ ppop(int op, ...) , pp.pass , keyname(X_BUILTIN) ); + if (pp.ppdefault && *pp.ppdefault) + sfprintf(sp, "#%s \"%s\"\n", dirname(INCLUDE), pp.ppdefault); + sfprintf(sp, +"\ +#%s !defined(__STDC__) && (!#option(compatibility) || #option(transition))\n\ +#%s __STDC__ #(STDC)\n\ +#%s\n\ +" + , dirname(IF) + , dirname(DEFINE) + , dirname(ENDIF) + ); t = sfstruse(sp); debug((-9, "\n/* begin initialization */\n%s/* end initialization */", t)); ppcomment = pp.comment; diff --git a/usr/src/lib/libpp/common/pppragma.c b/usr/src/lib/libpp/common/pppragma.c index bb442471e3..99d3dfa388 100644 --- a/usr/src/lib/libpp/common/pppragma.c +++ b/usr/src/lib/libpp/common/pppragma.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppprintf.c b/usr/src/lib/libpp/common/ppprintf.c index d1c1f9707a..4a7f09e8ba 100644 --- a/usr/src/lib/libpp/common/ppprintf.c +++ b/usr/src/lib/libpp/common/ppprintf.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppproto.c b/usr/src/lib/libpp/common/ppproto.c index b3e6794921..147aecf87c 100644 --- a/usr/src/lib/libpp/common/ppproto.c +++ b/usr/src/lib/libpp/common/ppproto.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/ppsearch.c b/usr/src/lib/libpp/common/ppsearch.c index 83b956bca9..9730ad177f 100644 --- a/usr/src/lib/libpp/common/ppsearch.c +++ b/usr/src/lib/libpp/common/ppsearch.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -82,7 +82,7 @@ ppmultiple(register struct ppfile* fp, register struct ppsymbol* test) { if (status != INC_CLEAR) { - if (status != INC_TEST && status->macro || !(pp.mode & ALLMULTIPLE) && !(pp.state & STRICT)) + if (status == INC_TEST || status->macro) { if ((pp.mode & (ALLMULTIPLE|LOADING)) == LOADING) fp->guard = INC_IGNORE; @@ -96,6 +96,8 @@ ppmultiple(register struct ppfile* fp, register struct ppsymbol* test) } if ((pp.mode & (ALLMULTIPLE|LOADING)) == LOADING) test = INC_IGNORE; + else + return 1; } fp->guard = test; return 1; @@ -605,8 +607,14 @@ ppsearch(char* file, int type, int flags) pp.include = 0; fd = -1; - dospath = 0; chop = 0; + if (s = strchr(file, '\\')) + { + do *s++ = '/'; while (s = strchr(s, '\\')); + dospath = 1; + } + else + dospath = 0; again: pathcanon(file, 0); if (chop) @@ -757,15 +765,6 @@ ppsearch(char* file, int type, int flags) switch (dospath) { - case 0: - if (s = strchr(file, '\\')) - { - do *s++ = '/'; while (s = strchr(s, '\\')); - pathcanon(file, 0); - dospath = 1; - goto again; - } - /*FALLTHROUGH*/ case 1: if (ppisid(file[0]) && file[1] == ':' && file[2] == '/') { diff --git a/usr/src/lib/libpp/common/ppsym.c b/usr/src/lib/libpp/common/ppsym.c index 5fa4d7ff23..1fd5ea9105 100644 --- a/usr/src/lib/libpp/common/ppsym.c +++ b/usr/src/lib/libpp/common/ppsym.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * diff --git a/usr/src/lib/libpp/common/pptrace.c b/usr/src/lib/libpp/common/pptrace.c index a10117f4bd..d46e50e23d 100644 --- a/usr/src/lib/libpp/common/pptrace.c +++ b/usr/src/lib/libpp/common/pptrace.c @@ -1,7 +1,7 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1986-2008 AT&T Intellectual Property * +* Copyright (c) 1986-2009 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * |