sh.glob.c (167466) | sh.glob.c (195609) |
---|---|
1/* $Header: /p/tcsh/cvsroot/tcsh/sh.glob.c,v 3.74 2006/10/14 17:57:21 christos Exp $ */ | 1/* $Header: /p/tcsh/cvsroot/tcsh/sh.glob.c,v 3.76 2008/06/19 15:20:56 christos Exp $ */ |
2/* 3 * sh.glob.c: Regular expression expansion 4 */ 5/*- 6 * Copyright (c) 1980, 1991 The Regents of the University of California. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33#include "sh.h" 34 | 2/* 3 * sh.glob.c: Regular expression expansion 4 */ 5/*- 6 * Copyright (c) 1980, 1991 The Regents of the University of California. 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33#include "sh.h" 34 |
35RCSID("$tcsh: sh.glob.c,v 3.74 2006/10/14 17:57:21 christos Exp $") | 35RCSID("$tcsh: sh.glob.c,v 3.76 2008/06/19 15:20:56 christos Exp $") |
36 37#include "tc.h" 38#include "tw.h" 39 40#include "glob.h" 41 42/* 43 * Values for gflag --- 618 unchanged lines hidden (view full) --- 662 for (rp = lp; *rp && *rp != '`'; rp++) 663 if (*rp == '\\') { 664 rp++; 665 if (!*rp) 666 goto oops; 667 } 668 if (!*rp) { 669 oops: | 36 37#include "tc.h" 38#include "tw.h" 39 40#include "glob.h" 41 42/* 43 * Values for gflag --- 618 unchanged lines hidden (view full) --- 662 for (rp = lp; *rp && *rp != '`'; rp++) 663 if (*rp == '\\') { 664 rp++; 665 if (!*rp) 666 goto oops; 667 } 668 if (!*rp) { 669 oops: |
670 cleanup_until(&bb); |
|
670 stderror(ERR_UNMATCHED, '`'); 671 } 672 ep = Strnsave(lp, rp - lp); 673 cleanup_push(ep, xfree); 674 backeval(&bb, &word, ep, literal); 675 cleanup_until(ep); 676 cp = rp + 1; 677 } --- 159 unchanged lines hidden (view full) --- 837 icnt = i; 838 } 839 if (hadnl) 840 break; 841 --icnt; 842 c = (*ip++ & TRIM); 843 if (c == 0) 844 break; | 671 stderror(ERR_UNMATCHED, '`'); 672 } 673 ep = Strnsave(lp, rp - lp); 674 cleanup_push(ep, xfree); 675 backeval(&bb, &word, ep, literal); 676 cleanup_until(ep); 677 cp = rp + 1; 678 } --- 159 unchanged lines hidden (view full) --- 838 icnt = i; 839 } 840 if (hadnl) 841 break; 842 --icnt; 843 c = (*ip++ & TRIM); 844 if (c == 0) 845 break; |
845#ifdef WINNT_NATIVE | 846#if defined(WINNT_NATIVE) || defined(__CYGWIN__) |
846 if (c == '\r') 847 c = ' '; | 847 if (c == '\r') 848 c = ' '; |
848#endif /* WINNT_NATIVE */ | 849#endif /* WINNT_NATIVE || __CYGWIN__ */ |
849 if (c == '\n') { 850 /* 851 * Continue around the loop one more time, so that we can eat 852 * the last newline without terminating this word. 853 */ 854 hadnl = 1; 855 continue; 856 } --- 168 unchanged lines hidden --- | 850 if (c == '\n') { 851 /* 852 * Continue around the loop one more time, so that we can eat 853 * the last newline without terminating this word. 854 */ 855 hadnl = 1; 856 continue; 857 } --- 168 unchanged lines hidden --- |