tabs, bools
This commit is contained in:
parent
ecef21a50a
commit
94acf23391
8
funcs.c
8
funcs.c
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.103 2009/04/05 12:35:30 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.104 2009/04/07 19:51:46 tg Exp $");
|
||||||
|
|
||||||
/* A leading = means assignments before command are kept;
|
/* A leading = means assignments before command are kept;
|
||||||
* a leading * means a POSIX special builtin;
|
* a leading * means a POSIX special builtin;
|
||||||
|
@ -72,8 +72,8 @@ struct kill_info {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct t_op {
|
static const struct t_op {
|
||||||
char op_text[4];
|
char op_text[4];
|
||||||
Test_op op_num;
|
Test_op op_num;
|
||||||
} u_ops[] = {
|
} u_ops[] = {
|
||||||
{"-a", TO_FILAXST },
|
{"-a", TO_FILAXST },
|
||||||
{"-b", TO_FILBDEV },
|
{"-b", TO_FILBDEV },
|
||||||
|
@ -2467,7 +2467,7 @@ c_test(const char **wp)
|
||||||
if (argc <= 5) {
|
if (argc <= 5) {
|
||||||
const char **owp = wp;
|
const char **owp = wp;
|
||||||
int invert = 0;
|
int invert = 0;
|
||||||
Test_op op;
|
Test_op op;
|
||||||
const char *opnd1, *opnd2;
|
const char *opnd1, *opnd2;
|
||||||
|
|
||||||
while (--argc >= 0) {
|
while (--argc >= 0) {
|
||||||
|
|
29
misc.c
29
misc.c
|
@ -9,7 +9,7 @@
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.102 2009/04/05 12:35:32 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.103 2009/04/07 19:51:47 tg Exp $");
|
||||||
|
|
||||||
#undef USE_CHVT
|
#undef USE_CHVT
|
||||||
#if defined(TIOCSCTTY) && !defined(MKSH_SMALL)
|
#if defined(TIOCSCTTY) && !defined(MKSH_SMALL)
|
||||||
|
@ -1108,19 +1108,18 @@ make_path(const char *cwd, const char *file,
|
||||||
XString *xsp,
|
XString *xsp,
|
||||||
int *phys_pathp)
|
int *phys_pathp)
|
||||||
{
|
{
|
||||||
int rval = 0;
|
int rval = 0;
|
||||||
int use_cdpath = 1;
|
bool use_cdpath = true;
|
||||||
char *plist;
|
char *plist;
|
||||||
int len;
|
int len, plen = 0;
|
||||||
int plen = 0;
|
char *xp = Xstring(*xsp, xp);
|
||||||
char *xp = Xstring(*xsp, xp);
|
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
file = null;
|
file = null;
|
||||||
|
|
||||||
if (file[0] == '/') {
|
if (file[0] == '/') {
|
||||||
*phys_pathp = 0;
|
*phys_pathp = 0;
|
||||||
use_cdpath = 0;
|
use_cdpath = false;
|
||||||
} else {
|
} else {
|
||||||
if (file[0] == '.') {
|
if (file[0] == '.') {
|
||||||
char c = file[1];
|
char c = file[1];
|
||||||
|
@ -1128,12 +1127,12 @@ make_path(const char *cwd, const char *file,
|
||||||
if (c == '.')
|
if (c == '.')
|
||||||
c = file[2];
|
c = file[2];
|
||||||
if (c == '/' || c == '\0')
|
if (c == '/' || c == '\0')
|
||||||
use_cdpath = 0;
|
use_cdpath = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
plist = *cdpathp;
|
plist = *cdpathp;
|
||||||
if (!plist)
|
if (!plist)
|
||||||
use_cdpath = 0;
|
use_cdpath = false;
|
||||||
else if (use_cdpath) {
|
else if (use_cdpath) {
|
||||||
char *pend;
|
char *pend;
|
||||||
|
|
||||||
|
@ -1143,7 +1142,7 @@ make_path(const char *cwd, const char *file,
|
||||||
*cdpathp = *pend ? pend + 1 : NULL;
|
*cdpathp = *pend ? pend + 1 : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((use_cdpath == 0 || !plen || plist[0] != '/') &&
|
if ((!use_cdpath || !plen || plist[0] != '/') &&
|
||||||
(cwd && *cwd)) {
|
(cwd && *cwd)) {
|
||||||
len = strlen(cwd);
|
len = strlen(cwd);
|
||||||
XcheckN(*xsp, xp, len);
|
XcheckN(*xsp, xp, len);
|
||||||
|
@ -1180,11 +1179,9 @@ make_path(const char *cwd, const char *file,
|
||||||
void
|
void
|
||||||
simplify_path(char *pathl)
|
simplify_path(char *pathl)
|
||||||
{
|
{
|
||||||
char *cur;
|
char *cur, *t;
|
||||||
char *t;
|
bool isrooted;
|
||||||
int isrooted;
|
char *very_start = pathl, *start;
|
||||||
char *very_start = pathl;
|
|
||||||
char *start;
|
|
||||||
|
|
||||||
if (!*pathl)
|
if (!*pathl)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue