* Solaris misses sig_t
* our gmatch becomes gmatchx, it's extended against sh(C)
This commit is contained in:
		
							
								
								
									
										6
									
								
								edit.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								edit.c
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| /**	$MirOS: src/bin/mksh/edit.c,v 1.1 2005/05/23 03:06:06 tg Exp $ */ | ||||
| /**	$MirOS: src/bin/mksh/edit.c,v 1.2 2005/05/23 15:18:15 tg Exp $ */ | ||||
| /*	$OpenBSD: edit.c,v 1.29 2005/04/13 02:33:08 deraadt Exp $	*/ | ||||
| /*	$OpenBSD: edit.h,v 1.8 2005/03/28 21:28:22 deraadt Exp $	*/ | ||||
| /*	$OpenBSD: emacs.c,v 1.37 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
| @@ -10,7 +10,7 @@ | ||||
| #include <ctype.h> | ||||
| #include <libgen.h> | ||||
|  | ||||
| __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.1 2005/05/23 03:06:06 tg Exp $"); | ||||
| __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.2 2005/05/23 15:18:15 tg Exp $"); | ||||
|  | ||||
| #define	BEL		0x07 | ||||
|  | ||||
| @@ -792,7 +792,7 @@ glob_table(const char *pat, XPtrV *wp, struct table *tp) | ||||
| 	struct tbl *te; | ||||
|  | ||||
| 	for (twalk(&ts, tp); (te = tnext(&ts)); ) { | ||||
| 		if (gmatch(te->name, pat, false)) | ||||
| 		if (gmatchx(te->name, pat, false)) | ||||
| 			XPput(*wp, str_save(te->name, ATEMP)); | ||||
| 	} | ||||
| } | ||||
|   | ||||
							
								
								
									
										14
									
								
								eval.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								eval.c
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| /**	$MirOS: src/bin/mksh/eval.c,v 1.1 2005/05/23 03:06:06 tg Exp $ */ | ||||
| /**	$MirOS: src/bin/mksh/eval.c,v 1.2 2005/05/23 15:18:15 tg Exp $ */ | ||||
| /*	$OpenBSD: eval.c,v 1.27 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
|  | ||||
| #include "sh.h" | ||||
| @@ -6,7 +6,7 @@ | ||||
| #include <dirent.h> | ||||
| #include <pwd.h> | ||||
|  | ||||
| __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.1 2005/05/23 03:06:06 tg Exp $"); | ||||
| __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.2 2005/05/23 15:18:15 tg Exp $"); | ||||
|  | ||||
| /* | ||||
|  * string expansion | ||||
| @@ -881,7 +881,7 @@ trimsub(char *str, char *pat, int how) | ||||
| 	case '#':		/* shortest at beginning */ | ||||
| 		for (p = str; p <= end; p++) { | ||||
| 			c = *p; *p = '\0'; | ||||
| 			if (gmatch(str, pat, false)) { | ||||
| 			if (gmatchx(str, pat, false)) { | ||||
| 				*p = c; | ||||
| 				return p; | ||||
| 			} | ||||
| @@ -891,7 +891,7 @@ trimsub(char *str, char *pat, int how) | ||||
| 	case '#'|0x80:	/* longest match at beginning */ | ||||
| 		for (p = end; p >= str; p--) { | ||||
| 			c = *p; *p = '\0'; | ||||
| 			if (gmatch(str, pat, false)) { | ||||
| 			if (gmatchx(str, pat, false)) { | ||||
| 				*p = c; | ||||
| 				return p; | ||||
| 			} | ||||
| @@ -900,13 +900,13 @@ trimsub(char *str, char *pat, int how) | ||||
| 		break; | ||||
| 	case '%':		/* shortest match at end */ | ||||
| 		for (p = end; p >= str; p--) { | ||||
| 			if (gmatch(p, pat, false)) | ||||
| 			if (gmatchx(p, pat, false)) | ||||
| 				return str_nsave(str, p - str, ATEMP); | ||||
| 		} | ||||
| 		break; | ||||
| 	case '%'|0x80:	/* longest match at end */ | ||||
| 		for (p = str; p <= end; p++) { | ||||
| 			if (gmatch(p, pat, false)) | ||||
| 			if (gmatchx(p, pat, false)) | ||||
| 				return str_nsave(str, p - str, ATEMP); | ||||
| 		} | ||||
| 		break; | ||||
| @@ -1061,7 +1061,7 @@ globit(XString *xs,	/* dest string */ | ||||
| 			    (name[1] == 0 || (name[1] == '.' && name[2] == 0))) | ||||
| 				continue; /* always ignore . and .. */ | ||||
| 			if ((*name == '.' && *sp != '.') || | ||||
| 			    !gmatch(name, sp, true)) | ||||
| 			    !gmatchx(name, sp, true)) | ||||
| 				continue; | ||||
|  | ||||
| 			len = strlen(d->d_name) + 1; | ||||
|   | ||||
							
								
								
									
										6
									
								
								exec.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								exec.c
									
									
									
									
									
								
							| @@ -1,11 +1,11 @@ | ||||
| /**	$MirOS: src/bin/mksh/exec.c,v 1.1 2005/05/23 03:06:07 tg Exp $ */ | ||||
| /**	$MirOS: src/bin/mksh/exec.c,v 1.2 2005/05/23 15:18:16 tg Exp $ */ | ||||
| /*	$OpenBSD: exec.c,v 1.41 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
|  | ||||
| #include "sh.h" | ||||
| #include <sys/stat.h> | ||||
| #include <ctype.h> | ||||
|  | ||||
| __RCSID("$MirOS: src/bin/mksh/exec.c,v 1.1 2005/05/23 03:06:07 tg Exp $"); | ||||
| __RCSID("$MirOS: src/bin/mksh/exec.c,v 1.2 2005/05/23 15:18:16 tg Exp $"); | ||||
|  | ||||
| static int	comexec(struct op *, struct tbl *volatile, char **, | ||||
| 		    int volatile); | ||||
| @@ -319,7 +319,7 @@ execute(struct op *volatile t, | ||||
| 		for (t = t->left; t != NULL && t->type == TPAT; t = t->right) | ||||
| 		    for (ap = t->vars; *ap; ap++) | ||||
| 			if ((s = evalstr(*ap, DOTILDE|DOPAT)) && | ||||
| 			    gmatch(cp, s, false)) | ||||
| 			    gmatchx(cp, s, false)) | ||||
| 				goto Found; | ||||
| 		break; | ||||
| 	  Found: | ||||
|   | ||||
							
								
								
									
										8
									
								
								funcs.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								funcs.c
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| /**	$MirOS: src/bin/mksh/funcs.c,v 1.2 2005/05/23 14:19:13 tg Exp $ */ | ||||
| /**	$MirOS: src/bin/mksh/funcs.c,v 1.3 2005/05/23 15:18:16 tg Exp $ */ | ||||
| /*	$OpenBSD: c_ksh.c,v 1.27 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
| /*	$OpenBSD: c_sh.c,v 1.29 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
| /*	$OpenBSD: c_test.c,v 1.17 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
| @@ -13,7 +13,7 @@ | ||||
| #include <ulimit.h> | ||||
| #endif | ||||
|  | ||||
| __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.2 2005/05/23 14:19:13 tg Exp $"); | ||||
| __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.3 2005/05/23 15:18:16 tg Exp $"); | ||||
|  | ||||
| int | ||||
| c_cd(char **wp) | ||||
| @@ -2515,11 +2515,11 @@ test_eval(Test_env *te, Test_op op, const char *opnd1, const char *opnd2, | ||||
| 	 */ | ||||
| 	case TO_STEQL: /* = */ | ||||
| 		if (te->flags & TEF_DBRACKET) | ||||
| 			return gmatch(opnd1, opnd2, false); | ||||
| 			return gmatchx(opnd1, opnd2, false); | ||||
| 		return strcmp(opnd1, opnd2) == 0; | ||||
| 	case TO_STNEQ: /* != */ | ||||
| 		if (te->flags & TEF_DBRACKET) | ||||
| 			return !gmatch(opnd1, opnd2, false); | ||||
| 			return !gmatchx(opnd1, opnd2, false); | ||||
| 		return strcmp(opnd1, opnd2) != 0; | ||||
| 	case TO_STLT: /* < */ | ||||
| 		return strcmp(opnd1, opnd2) < 0; | ||||
|   | ||||
							
								
								
									
										6
									
								
								misc.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								misc.c
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| /**	$MirOS: src/bin/mksh/misc.c,v 1.1 2005/05/23 03:06:08 tg Exp $ */ | ||||
| /**	$MirOS: src/bin/mksh/misc.c,v 1.2 2005/05/23 15:18:16 tg Exp $ */ | ||||
| /*	$OpenBSD: misc.c,v 1.28 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
| /*	$OpenBSD: path.c,v 1.12 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
|  | ||||
| @@ -7,7 +7,7 @@ | ||||
| #include <sys/param.h>	/* for MAXPATHLEN */ | ||||
| #include <sys/stat.h> | ||||
|  | ||||
| __RCSID("$MirOS: src/bin/mksh/misc.c,v 1.1 2005/05/23 03:06:08 tg Exp $"); | ||||
| __RCSID("$MirOS: src/bin/mksh/misc.c,v 1.2 2005/05/23 15:18:16 tg Exp $"); | ||||
|  | ||||
| short chtypes[UCHAR_MAX+1];	/* type bits for unsigned char */ | ||||
|  | ||||
| @@ -471,7 +471,7 @@ bi_getn(const char *as, int *ai) | ||||
|  */ | ||||
|  | ||||
| int | ||||
| gmatch(const char *s, const char *p, int isfile) | ||||
| gmatchx(const char *s, const char *p, int isfile) | ||||
| { | ||||
| 	const char *se, *pe; | ||||
|  | ||||
|   | ||||
							
								
								
									
										8
									
								
								sh.h
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								sh.h
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| /**	$MirOS: src/bin/mksh/sh.h,v 1.2 2005/05/23 14:19:14 tg Exp $ */ | ||||
| /**	$MirOS: src/bin/mksh/sh.h,v 1.3 2005/05/23 15:18:17 tg Exp $ */ | ||||
| /*	$OpenBSD: sh.h,v 1.27 2005/03/28 21:33:04 deraadt Exp $	*/ | ||||
| /*	$OpenBSD: shf.h,v 1.5 2005/03/30 17:16:37 deraadt Exp $	*/ | ||||
| /*	$OpenBSD: table.h,v 1.6 2004/12/18 20:55:52 millert Exp $	*/ | ||||
| @@ -256,6 +256,10 @@ struct temp { | ||||
| #define shl_out		(&shf_iob[2]) | ||||
| EXTERN int shl_stdout_ok; | ||||
|  | ||||
| #ifdef __sun__ | ||||
| typedef void (*sig_t)(int); | ||||
| #endif | ||||
|  | ||||
| /* | ||||
|  * trap handlers | ||||
|  */ | ||||
| @@ -1175,7 +1179,7 @@ void	change_flag(enum sh_flag, int, int); | ||||
| int	parse_args(char **, int, int *); | ||||
| int	getn(const char *, int *); | ||||
| int	bi_getn(const char *, int *); | ||||
| int	gmatch(const char *, const char *, int); | ||||
| int	gmatchx(const char *, const char *, int); | ||||
| int	has_globbing(const char *, const char *); | ||||
| const unsigned char *pat_scan(const unsigned char *, const unsigned char *, | ||||
|     int); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user