* Solaris misses sig_t
* our gmatch becomes gmatchx, it's extended against sh(C)
This commit is contained in:
parent
ca0fb8f0da
commit
b8a06e0fbe
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.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: 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 $ */
|
/* $OpenBSD: emacs.c,v 1.37 2005/03/30 17:16:37 deraadt Exp $ */
|
||||||
@ -10,7 +10,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <libgen.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
|
#define BEL 0x07
|
||||||
|
|
||||||
@ -792,7 +792,7 @@ glob_table(const char *pat, XPtrV *wp, struct table *tp)
|
|||||||
struct tbl *te;
|
struct tbl *te;
|
||||||
|
|
||||||
for (twalk(&ts, tp); (te = tnext(&ts)); ) {
|
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));
|
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 $ */
|
/* $OpenBSD: eval.c,v 1.27 2005/03/30 17:16:37 deraadt Exp $ */
|
||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
@ -6,7 +6,7 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <pwd.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
|
* string expansion
|
||||||
@ -881,7 +881,7 @@ trimsub(char *str, char *pat, int how)
|
|||||||
case '#': /* shortest at beginning */
|
case '#': /* shortest at beginning */
|
||||||
for (p = str; p <= end; p++) {
|
for (p = str; p <= end; p++) {
|
||||||
c = *p; *p = '\0';
|
c = *p; *p = '\0';
|
||||||
if (gmatch(str, pat, false)) {
|
if (gmatchx(str, pat, false)) {
|
||||||
*p = c;
|
*p = c;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -891,7 +891,7 @@ trimsub(char *str, char *pat, int how)
|
|||||||
case '#'|0x80: /* longest match at beginning */
|
case '#'|0x80: /* longest match at beginning */
|
||||||
for (p = end; p >= str; p--) {
|
for (p = end; p >= str; p--) {
|
||||||
c = *p; *p = '\0';
|
c = *p; *p = '\0';
|
||||||
if (gmatch(str, pat, false)) {
|
if (gmatchx(str, pat, false)) {
|
||||||
*p = c;
|
*p = c;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -900,13 +900,13 @@ trimsub(char *str, char *pat, int how)
|
|||||||
break;
|
break;
|
||||||
case '%': /* shortest match at end */
|
case '%': /* shortest match at end */
|
||||||
for (p = end; p >= str; p--) {
|
for (p = end; p >= str; p--) {
|
||||||
if (gmatch(p, pat, false))
|
if (gmatchx(p, pat, false))
|
||||||
return str_nsave(str, p - str, ATEMP);
|
return str_nsave(str, p - str, ATEMP);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '%'|0x80: /* longest match at end */
|
case '%'|0x80: /* longest match at end */
|
||||||
for (p = str; p <= end; p++) {
|
for (p = str; p <= end; p++) {
|
||||||
if (gmatch(p, pat, false))
|
if (gmatchx(p, pat, false))
|
||||||
return str_nsave(str, p - str, ATEMP);
|
return str_nsave(str, p - str, ATEMP);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1061,7 +1061,7 @@ globit(XString *xs, /* dest string */
|
|||||||
(name[1] == 0 || (name[1] == '.' && name[2] == 0)))
|
(name[1] == 0 || (name[1] == '.' && name[2] == 0)))
|
||||||
continue; /* always ignore . and .. */
|
continue; /* always ignore . and .. */
|
||||||
if ((*name == '.' && *sp != '.') ||
|
if ((*name == '.' && *sp != '.') ||
|
||||||
!gmatch(name, sp, true))
|
!gmatchx(name, sp, true))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
len = strlen(d->d_name) + 1;
|
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 $ */
|
/* $OpenBSD: exec.c,v 1.41 2005/03/30 17:16:37 deraadt Exp $ */
|
||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <ctype.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 **,
|
static int comexec(struct op *, struct tbl *volatile, char **,
|
||||||
int volatile);
|
int volatile);
|
||||||
@ -319,7 +319,7 @@ execute(struct op *volatile t,
|
|||||||
for (t = t->left; t != NULL && t->type == TPAT; t = t->right)
|
for (t = t->left; t != NULL && t->type == TPAT; t = t->right)
|
||||||
for (ap = t->vars; *ap; ap++)
|
for (ap = t->vars; *ap; ap++)
|
||||||
if ((s = evalstr(*ap, DOTILDE|DOPAT)) &&
|
if ((s = evalstr(*ap, DOTILDE|DOPAT)) &&
|
||||||
gmatch(cp, s, false))
|
gmatchx(cp, s, false))
|
||||||
goto Found;
|
goto Found;
|
||||||
break;
|
break;
|
||||||
Found:
|
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_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_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 $ */
|
/* $OpenBSD: c_test.c,v 1.17 2005/03/30 17:16:37 deraadt Exp $ */
|
||||||
@ -13,7 +13,7 @@
|
|||||||
#include <ulimit.h>
|
#include <ulimit.h>
|
||||||
#endif
|
#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
|
int
|
||||||
c_cd(char **wp)
|
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: /* = */
|
case TO_STEQL: /* = */
|
||||||
if (te->flags & TEF_DBRACKET)
|
if (te->flags & TEF_DBRACKET)
|
||||||
return gmatch(opnd1, opnd2, false);
|
return gmatchx(opnd1, opnd2, false);
|
||||||
return strcmp(opnd1, opnd2) == 0;
|
return strcmp(opnd1, opnd2) == 0;
|
||||||
case TO_STNEQ: /* != */
|
case TO_STNEQ: /* != */
|
||||||
if (te->flags & TEF_DBRACKET)
|
if (te->flags & TEF_DBRACKET)
|
||||||
return !gmatch(opnd1, opnd2, false);
|
return !gmatchx(opnd1, opnd2, false);
|
||||||
return strcmp(opnd1, opnd2) != 0;
|
return strcmp(opnd1, opnd2) != 0;
|
||||||
case TO_STLT: /* < */
|
case TO_STLT: /* < */
|
||||||
return strcmp(opnd1, opnd2) < 0;
|
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: 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 $ */
|
/* $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/param.h> /* for MAXPATHLEN */
|
||||||
#include <sys/stat.h>
|
#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 */
|
short chtypes[UCHAR_MAX+1]; /* type bits for unsigned char */
|
||||||
|
|
||||||
@ -471,7 +471,7 @@ bi_getn(const char *as, int *ai)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
gmatch(const char *s, const char *p, int isfile)
|
gmatchx(const char *s, const char *p, int isfile)
|
||||||
{
|
{
|
||||||
const char *se, *pe;
|
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: 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: 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 $ */
|
/* $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])
|
#define shl_out (&shf_iob[2])
|
||||||
EXTERN int shl_stdout_ok;
|
EXTERN int shl_stdout_ok;
|
||||||
|
|
||||||
|
#ifdef __sun__
|
||||||
|
typedef void (*sig_t)(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* trap handlers
|
* trap handlers
|
||||||
*/
|
*/
|
||||||
@ -1175,7 +1179,7 @@ void change_flag(enum sh_flag, int, int);
|
|||||||
int parse_args(char **, int, int *);
|
int parse_args(char **, int, int *);
|
||||||
int getn(const char *, int *);
|
int getn(const char *, int *);
|
||||||
int bi_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 *);
|
int has_globbing(const char *, const char *);
|
||||||
const unsigned char *pat_scan(const unsigned char *, const unsigned char *,
|
const unsigned char *pat_scan(const unsigned char *, const unsigned char *,
|
||||||
int);
|
int);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user