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"
__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 a POSIX special builtin;

23
misc.c
View File

@ -9,7 +9,7 @@
#include <grp.h>
#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
#if defined(TIOCSCTTY) && !defined(MKSH_SMALL)
@ -1109,10 +1109,9 @@ make_path(const char *cwd, const char *file,
int *phys_pathp)
{
int rval = 0;
int use_cdpath = 1;
bool use_cdpath = true;
char *plist;
int len;
int plen = 0;
int len, plen = 0;
char *xp = Xstring(*xsp, xp);
if (!file)
@ -1120,7 +1119,7 @@ make_path(const char *cwd, const char *file,
if (file[0] == '/') {
*phys_pathp = 0;
use_cdpath = 0;
use_cdpath = false;
} else {
if (file[0] == '.') {
char c = file[1];
@ -1128,12 +1127,12 @@ make_path(const char *cwd, const char *file,
if (c == '.')
c = file[2];
if (c == '/' || c == '\0')
use_cdpath = 0;
use_cdpath = false;
}
plist = *cdpathp;
if (!plist)
use_cdpath = 0;
use_cdpath = false;
else if (use_cdpath) {
char *pend;
@ -1143,7 +1142,7 @@ make_path(const char *cwd, const char *file,
*cdpathp = *pend ? pend + 1 : NULL;
}
if ((use_cdpath == 0 || !plen || plist[0] != '/') &&
if ((!use_cdpath || !plen || plist[0] != '/') &&
(cwd && *cwd)) {
len = strlen(cwd);
XcheckN(*xsp, xp, len);
@ -1180,11 +1179,9 @@ make_path(const char *cwd, const char *file,
void
simplify_path(char *pathl)
{
char *cur;
char *t;
int isrooted;
char *very_start = pathl;
char *start;
char *cur, *t;
bool isrooted;
char *very_start = pathl, *start;
if (!*pathl)
return;