rename the “tilde” function; apparently, some system headers define it

This commit is contained in:
tg 2014-11-19 21:49:12 +00:00
parent 9b31399aec
commit 517bd63fe5
3 changed files with 7 additions and 7 deletions

4
edit.c
View File

@ -28,7 +28,7 @@
#ifndef MKSH_NO_CMDLINE_EDITING #ifndef MKSH_NO_CMDLINE_EDITING
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.277 2014/11/14 20:00:40 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.278 2014/11/19 21:49:10 tg Exp $");
/* /*
* in later versions we might use libtermcap for this, but since external * in later versions we might use libtermcap for this, but since external
@ -327,7 +327,7 @@ x_glob_hlp_tilde_and_rem_qchar(char *s, bool magic_flag)
/* ok, so split into "~foo"/"bar" or "~"/"baz" */ /* ok, so split into "~foo"/"bar" or "~"/"baz" */
*cp++ = 0; *cp++ = 0;
/* try to expand the tilde */ /* try to expand the tilde */
if (!(dp = tilde(s + 1))) { if (!(dp = do_tilde(s + 1))) {
/* nope, revert damage */ /* nope, revert damage */
*--cp = '/'; *--cp = '/';
} else { } else {

6
eval.c
View File

@ -23,7 +23,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.158 2014/10/19 21:53:07 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.159 2014/11/19 21:49:12 tg Exp $");
/* /*
* string expansion * string expansion
@ -1681,7 +1681,7 @@ maybe_expand_tilde(const char *p, XString *dsp, char **dpp, int isassign)
} }
*tp = '\0'; *tp = '\0';
r = (p[0] == EOS || p[0] == CHAR || p[0] == CSUBST) ? r = (p[0] == EOS || p[0] == CHAR || p[0] == CSUBST) ?
tilde(Xstring(ts, tp)) : NULL; do_tilde(Xstring(ts, tp)) : NULL;
Xfree(ts, tp); Xfree(ts, tp);
if (r) { if (r) {
while (*r) { while (*r) {
@ -1703,7 +1703,7 @@ maybe_expand_tilde(const char *p, XString *dsp, char **dpp, int isassign)
*/ */
char * char *
tilde(char *cp) do_tilde(char *cp)
{ {
char *dp = null; char *dp = null;

4
sh.h
View File

@ -169,7 +169,7 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.703 2014/11/19 18:44:11 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.704 2014/11/19 21:49:12 tg Exp $");
#endif #endif
#define MKSH_VERSION "R50 2014/11/19" #define MKSH_VERSION "R50 2014/11/19"
@ -1645,7 +1645,7 @@ char *evalonestr(const char *cp, int);
char *debunk(char *, const char *, size_t); char *debunk(char *, const char *, size_t);
void expand(const char *, XPtrV *, int); void expand(const char *, XPtrV *, int);
int glob_str(char *, XPtrV *, bool); int glob_str(char *, XPtrV *, bool);
char *tilde(char *); char *do_tilde(char *);
/* exec.c */ /* exec.c */
int execute(struct op * volatile, volatile int, volatile int * volatile); int execute(struct op * volatile, volatile int, volatile int * volatile);
int shcomexec(const char **); int shcomexec(const char **);