sh.dol.c (69408) | sh.dol.c (83098) |
---|---|
1/* $Header: /src/pub/tcsh/sh.dol.c,v 3.45 2000/11/19 20:50:43 christos Exp $ */ | 1/* $Header: /src/pub/tcsh/sh.dol.c,v 3.47 2001/07/25 15:48:04 christos Exp $ */ |
2/* 3 * sh.dol.c: Variable substitutions 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 --- 21 unchanged lines hidden (view full) --- 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37#include "sh.h" 38 | 2/* 3 * sh.dol.c: Variable substitutions 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 --- 21 unchanged lines hidden (view full) --- 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 */ 37#include "sh.h" 38 |
39RCSID("$Id: sh.dol.c,v 3.45 2000/11/19 20:50:43 christos Exp $") | 39RCSID("$Id: sh.dol.c,v 3.47 2001/07/25 15:48:04 christos Exp $") |
40 41/* 42 * C shell 43 */ 44 45/* 46 * These routines perform variable substitution and quoting via ' and ". 47 * To this point these constructs have been preserved in the divided --- 61 unchanged lines hidden (view full) --- 109 return; 110 /* Note that t_dcom isn't trimmed thus !...:q's aren't lost */ 111 for (pp = t->t_dcom; (p = *pp++) != NULL;) { 112 for (; *p; p++) { 113#ifdef DSPMBYTE 114 if (Ismbyte1(*p) && *(p + 1)) 115 p ++; 116 else | 40 41/* 42 * C shell 43 */ 44 45/* 46 * These routines perform variable substitution and quoting via ' and ". 47 * To this point these constructs have been preserved in the divided --- 61 unchanged lines hidden (view full) --- 109 return; 110 /* Note that t_dcom isn't trimmed thus !...:q's aren't lost */ 111 for (pp = t->t_dcom; (p = *pp++) != NULL;) { 112 for (; *p; p++) { 113#ifdef DSPMBYTE 114 if (Ismbyte1(*p) && *(p + 1)) 115 p ++; 116 else |
117#endif DSPMBYTE | 117#endif /* DSPMBYTE */ |
118 if (cmap(*p, _DOL | QUOTES)) { /* $, \, ', ", ` */ 119 Dfix2(t->t_dcom); /* found one */ 120 blkfree(t->t_dcom); 121 t->t_dcom = gargv; 122 gargv = 0; 123 return; 124 } 125 } --- 912 unchanged lines hidden (view full) --- 1038#endif 1039 (void) close(0); 1040#ifndef O_TEMPORARY 1041# define O_TEMPORARY 0 1042#endif 1043#ifndef O_EXCL 1044# define O_EXCL 0 1045#endif | 118 if (cmap(*p, _DOL | QUOTES)) { /* $, \, ', ", ` */ 119 Dfix2(t->t_dcom); /* found one */ 120 blkfree(t->t_dcom); 121 t->t_dcom = gargv; 122 gargv = 0; 123 return; 124 } 125 } --- 912 unchanged lines hidden (view full) --- 1038#endif 1039 (void) close(0); 1040#ifndef O_TEMPORARY 1041# define O_TEMPORARY 0 1042#endif 1043#ifndef O_EXCL 1044# define O_EXCL 0 1045#endif |
1046 if (open(tmp, O_RDWR|O_CREAT|O_EXCL|O_TEMPORARY) == -1) { | 1046 if (open(tmp, O_RDWR|O_CREAT|O_EXCL|O_TEMPORARY, 0600) == -1) { |
1047 int oerrno = errno; 1048#ifndef WINNT_NATIVE 1049 if (errno == EEXIST) { 1050 if (unlink(tmp) == -1) { 1051 (void) gettimeofday(&tv, NULL); 1052 shtemp = Strspl(STRtmpsh, putn((((int)tv.tv_sec) ^ 1053 ((int)tv.tv_usec) ^ ((int)getpid())) & 0x00ffffff)); 1054 } --- 139 unchanged lines hidden --- | 1047 int oerrno = errno; 1048#ifndef WINNT_NATIVE 1049 if (errno == EEXIST) { 1050 if (unlink(tmp) == -1) { 1051 (void) gettimeofday(&tv, NULL); 1052 shtemp = Strspl(STRtmpsh, putn((((int)tv.tv_sec) ^ 1053 ((int)tv.tv_usec) ^ ((int)getpid())) & 0x00ffffff)); 1054 } --- 139 unchanged lines hidden --- |