implement $KSH_MATCH and, to make it usable, ${foo@/bar/baz};
add a real-life example (for slagtc’s programmable tab completion) to the manpage
This commit is contained in:
14
var.c
14
var.c
@ -28,7 +28,7 @@
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.206 2016/07/25 21:02:13 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.207 2016/08/01 21:38:07 tg Exp $");
|
||||
|
||||
/*-
|
||||
* Variables
|
||||
@ -1739,3 +1739,15 @@ rndpush(const void *s)
|
||||
BAFHUpdateOctet_reg(h, 0);
|
||||
qh_state = h;
|
||||
}
|
||||
|
||||
/* record last glob match */
|
||||
void
|
||||
record_match(const char *istr)
|
||||
{
|
||||
struct tbl *vp;
|
||||
|
||||
vp = local("KSH_MATCH", false);
|
||||
unset(vp, 1);
|
||||
vp->flag = DEFINED | RDONLY;
|
||||
setstr(vp, istr, 0x4);
|
||||
}
|
||||
|
Reference in New Issue
Block a user