• remove strcasestr.c, use home-grown implementation¹, call it stricmp,
and have it return an API-correct const char * • enhance and stylify comments • a little KNF and simplifications • #ifdef DEBUG: replace strchr and strstr with ucstrchr and ucstrstr that take and return a non-const char *, and fix the violations • new cstrchr, cstrstr (take and give const char *) • new vstrchr, vstrstr (take const or not, give boolean value) • new afreechk(x) = afreechv(x,x) = if (x1) afree(x2, ATEMP) • new ksh_isdash(str) = (str != NULL) && !strcmp(str, "-") • replace the only use of strrchr with inlined code to shrink • minor man page fixes • Minix 3 signames are autogenerated with gcc • rename strlfun.c to strlcpy.c since we don't do strlcat(3) anyway, only strlcpy(3), and shorten it • dot.mkshrc: move MKSH=… down to the export line to not disturb the PS1 visual impression ☺ • dot.mkshrc: Lstripcom(): optimise • bump version ¹) side effect from creating API-correct cstrchr, cstrstr, etc. uses goto so it must be better ☻ tested on mirbsd-current via both Makefile and Build.sh
This commit is contained in:
14
tree.c
14
tree.c
@ -2,18 +2,18 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.8 2007/03/04 00:13:17 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.9 2007/03/04 03:04:28 tg Exp $");
|
||||
|
||||
#define INDENT 4
|
||||
|
||||
#define tputc(c, shf) shf_putchar(c, shf);
|
||||
static void ptree(struct op *, int, struct shf *);
|
||||
static void pioact(struct shf *, int, struct ioword *);
|
||||
static void tputC(int, struct shf *);
|
||||
static void tputS(char *, struct shf *);
|
||||
static void vfptreef(struct shf *, int, const char *, va_list);
|
||||
static void ptree(struct op *, int, struct shf *);
|
||||
static void pioact(struct shf *, int, struct ioword *);
|
||||
static void tputC(int, struct shf *);
|
||||
static void tputS(char *, struct shf *);
|
||||
static void vfptreef(struct shf *, int, const char *, va_list);
|
||||
static struct ioword **iocopy(struct ioword **, Area *);
|
||||
static void iofree(struct ioword **, Area *);
|
||||
static void iofree(struct ioword **, Area *);
|
||||
|
||||
/*
|
||||
* print a command tree
|
||||
|
Reference in New Issue
Block a user