diff --git a/misc.c b/misc.c index 6bb1e6a..bdf7e97 100644 --- a/misc.c +++ b/misc.c @@ -3,7 +3,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.19 2006/11/09 14:19:31 tg Exp $\t" +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.20 2006/11/09 20:53:41 tg Exp $\t" MKSH_SH_H_ID); short chtypes[UCHAR_MAX+1]; /* type bits for unsigned char */ @@ -81,6 +81,12 @@ str_nsave(const char *s, int n, Area *ap) return (ns); } +char * +str_save(const char *s, Area *ap) +{ + return (str_nsave(s, s ? strlen(s) : 0, ap)); +} + /* called from XcheckN() to grow buffer */ char * Xcheck_grow_(XString *xsp, char *xp, unsigned more) diff --git a/sh.h b/sh.h index 0bc79b2..d0672cb 100644 --- a/sh.h +++ b/sh.h @@ -8,7 +8,7 @@ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ -#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.59 2006/11/09 15:03:56 tg Exp $" +#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.60 2006/11/09 20:53:42 tg Exp $" #define MKSH_VERSION "R29 2006/11/09" #if HAVE_SYS_PARAM_H @@ -1217,7 +1217,7 @@ struct tbl **ktsort(struct table *); void setctypes(const char *, int); void initctypes(void); char *ulton(unsigned long, int); -#define str_save(s, a) str_nsave((s), (s) ? strlen(s) : 0, a) +char *str_save(const char *, Area *); char *str_nsave(const char *, int, Area *); int option(const char *); char *getoptions(void);