tabs, bools

This commit is contained in:
tg 2009-04-07 19:51:47 +00:00
parent ecef21a50a
commit 94acf23391
2 changed files with 17 additions and 20 deletions

View File

@ -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;

23
misc.c
View File

@ -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)
@ -1109,10 +1109,9 @@ make_path(const char *cwd, const char *file,
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)
@ -1120,7 +1119,7 @@ make_path(const char *cwd, const char *file,
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;