- Timestamp:
- Sep 10, 2020, 2:06:29 PM (5 years ago)
- Location:
- trunk/src/kash
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/redir.c
r3438 r3442 90 90 STATIC void openredirect(shinstance *, union node *, char[10], int); 91 91 STATIC int openhere(shinstance *, union node *); 92 93 94 #ifndef SH_FORKED_MODE 95 void 96 subshellinitredir(shinstance *psh, shinstance *inherit) 97 { 98 /* We can have a redirlist here if we're handling backtick while expanding 99 arguments, just copy it even if the subshell probably doesn't need it. */ 100 struct redirtab *src = inherit->redirlist; 101 if (src) 102 { 103 struct redirtab **dstp = &psh->redirlist; 104 do 105 { 106 struct redirtab *dst = ckmalloc(psh, sizeof(dst)); 107 memcpy(dst->renamed, src->renamed, sizeof(dst->renamed)); 108 *dstp = dst; 109 dstp = &dst->next; 110 src = src->next; 111 } while (src); 112 *dstp = NULL; 113 114 psh->fd0_redirected = inherit->fd0_redirected; 115 } 116 } 117 #endif /* !SH_FORKED_MODE */ 92 118 93 119 -
trunk/src/kash/redir.h
r3436 r3442 40 40 41 41 union node; 42 #ifndef SH_FORKED_MODE 43 void subshellinitredir(shinstance *, shinstance *); 44 #endif 42 45 void redirect(struct shinstance *, union node *, int); 43 46 void popredir(struct shinstance *); -
trunk/src/kash/shinstance.c
r3441 r3442 733 733 /* The rest are internal to the parser, as I see them, and can be ignored. */ 734 734 735 /* redir.c - we shouldn't sub-shell with redirlist as non-NULL, I think. */ 736 assert(inherit->redirlist == NULL); 737 assert(inherit->fd0_redirected == 0); /* (follows from redirlist == NULL) */ 735 /* redir.c */ 736 subshellinitredir(psh, inherit); 738 737 739 738 /* show.c */
Note:
See TracChangeset
for help on using the changeset viewer.