* sh.h: note that file descriptors SHALL be <100
* syn.c: fix bashiop-4 regression test; failed due to me using a simple string when a wdstring was expected, sorry; the new code assumes file descriptors take up a maximum of two characters
This commit is contained in:
		
							
								
								
									
										3
									
								
								sh.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								sh.h
									
									
									
									
									
								
							| @@ -103,7 +103,7 @@ | |||||||
| #define __SCCSID(x)	__IDSTRING(sccsid,x) | #define __SCCSID(x)	__IDSTRING(sccsid,x) | ||||||
|  |  | ||||||
| #ifdef EXTERN | #ifdef EXTERN | ||||||
| __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.263 2008/12/02 12:39:38 tg Exp $"); | __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.264 2008/12/02 13:20:39 tg Exp $"); | ||||||
| #endif | #endif | ||||||
| #define MKSH_VERSION "R36 2008/12/02" | #define MKSH_VERSION "R36 2008/12/02" | ||||||
|  |  | ||||||
| @@ -260,6 +260,7 @@ extern int __cdecl setegid(gid_t); | |||||||
| /* Table flag type - needs > 16 and < 32 bits */ | /* Table flag type - needs > 16 and < 32 bits */ | ||||||
| typedef int32_t Tflag; | typedef int32_t Tflag; | ||||||
|  |  | ||||||
|  | /* these shall be smaller than 100 */ | ||||||
| #ifdef MKSH_SMALL | #ifdef MKSH_SMALL | ||||||
| #define NUFILE		32	/* Number of user-accessible files */ | #define NUFILE		32	/* Number of user-accessible files */ | ||||||
| #define FDBASE		10	/* First file usable by Shell */ | #define FDBASE		10	/* First file usable by Shell */ | ||||||
|   | |||||||
							
								
								
									
										14
									
								
								syn.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								syn.c
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | |||||||
|  |  | ||||||
| #include "sh.h" | #include "sh.h" | ||||||
|  |  | ||||||
| __RCSID("$MirOS: src/bin/mksh/syn.c,v 1.30 2008/11/12 00:54:51 tg Exp $"); | __RCSID("$MirOS: src/bin/mksh/syn.c,v 1.31 2008/12/02 13:20:40 tg Exp $"); | ||||||
|  |  | ||||||
| struct nesting_state { | struct nesting_state { | ||||||
| 	int start_token;	/* token than began nesting (eg, FOR) */ | 	int start_token;	/* token than began nesting (eg, FOR) */ | ||||||
| @@ -170,12 +170,22 @@ synio(int cf) | |||||||
| 		iop->name = yylval.cp; | 		iop->name = yylval.cp; | ||||||
|  |  | ||||||
| 	if (iop->flag & IOBASH) { | 	if (iop->flag & IOBASH) { | ||||||
|  | 		char *cp; | ||||||
|  |  | ||||||
| 		nextiop = alloc(1, sizeof (*iop), ATEMP); | 		nextiop = alloc(1, sizeof (*iop), ATEMP); | ||||||
|  | 		nextiop->name = cp = alloc(5, 1, ATEMP); | ||||||
|  |  | ||||||
|  | 		if (iop->unit > 9) { | ||||||
|  | 			*cp++ = CHAR; | ||||||
|  | 			*cp++ = '0' + (iop->unit / 10); | ||||||
|  | 		} | ||||||
|  | 		*cp++ = CHAR; | ||||||
|  | 		*cp++ = '0' + (iop->unit % 10); | ||||||
|  | 		*cp = EOS; | ||||||
|  |  | ||||||
| 		iop->flag &= ~IOBASH; | 		iop->flag &= ~IOBASH; | ||||||
| 		nextiop->unit = 2; | 		nextiop->unit = 2; | ||||||
| 		nextiop->flag = IODUP; | 		nextiop->flag = IODUP; | ||||||
| 		nextiop->name = shf_smprintf("%d", iop->unit); |  | ||||||
| 		nextiop->delim = NULL; | 		nextiop->delim = NULL; | ||||||
| 		nextiop->heredoc = NULL; | 		nextiop->heredoc = NULL; | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user