more int→bool
This commit is contained in:
parent
9b8d4023fa
commit
7cb17b16a0
4
misc.c
4
misc.c
@ -29,7 +29,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.115 2009/08/08 13:08:52 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.116 2009/08/28 21:04:16 tg Exp $");
|
||||||
|
|
||||||
#undef USE_CHVT
|
#undef USE_CHVT
|
||||||
/* XXX conditions correct? */
|
/* XXX conditions correct? */
|
||||||
@ -446,7 +446,7 @@ parse_args(const char **argv,
|
|||||||
xstrcmp);
|
xstrcmp);
|
||||||
}
|
}
|
||||||
if (arrayset) {
|
if (arrayset) {
|
||||||
set_array(array, arrayset, argv + go.optind);
|
set_array(array, arrayset > 0 ? true : false, argv + go.optind);
|
||||||
for (; argv[go.optind]; go.optind++)
|
for (; argv[go.optind]; go.optind++)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
4
sh.h
4
sh.h
@ -134,7 +134,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERN
|
#ifdef EXTERN
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.330 2009/08/28 21:01:26 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.331 2009/08/28 21:04:17 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#define MKSH_VERSION "R39 2009/08/08"
|
#define MKSH_VERSION "R39 2009/08/08"
|
||||||
|
|
||||||
@ -1647,7 +1647,7 @@ void change_random(unsigned long);
|
|||||||
void change_winsz(void);
|
void change_winsz(void);
|
||||||
int array_ref_len(const char *);
|
int array_ref_len(const char *);
|
||||||
char *arrayname(const char *);
|
char *arrayname(const char *);
|
||||||
void set_array(const char *, int, const char **);
|
void set_array(const char *, bool, const char **);
|
||||||
|
|
||||||
enum Test_op {
|
enum Test_op {
|
||||||
TO_NONOP = 0, /* non-operator */
|
TO_NONOP = 0, /* non-operator */
|
||||||
|
8
var.c
8
var.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.82 2009/08/28 21:01:27 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.83 2009/08/28 21:04:18 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Variables
|
* Variables
|
||||||
@ -1315,10 +1315,10 @@ arrayname(const char *str)
|
|||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set (or overwrite, if !reset) the array variable var to the values in vals.
|
/* Set (or overwrite, if reset) the array variable var to the values in vals.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
set_array(const char *var, int reset, const char **vals)
|
set_array(const char *var, bool reset, const char **vals)
|
||||||
{
|
{
|
||||||
struct tbl *vp, *vq;
|
struct tbl *vp, *vq;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
@ -1330,7 +1330,7 @@ set_array(const char *var, int reset, const char **vals)
|
|||||||
if ((vp->flag&RDONLY))
|
if ((vp->flag&RDONLY))
|
||||||
errorf("%s: is read only", var);
|
errorf("%s: is read only", var);
|
||||||
/* This code is quite non-optimal */
|
/* This code is quite non-optimal */
|
||||||
if (reset > 0)
|
if (reset)
|
||||||
/* trash existing values and attributes */
|
/* trash existing values and attributes */
|
||||||
unset(vp, 0);
|
unset(vp, 0);
|
||||||
/* todo: would be nice for assignment to completely succeed or
|
/* todo: would be nice for assignment to completely succeed or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user