X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/fe5634f616c5bf0afdf883045dc309e82c6ac41c..5ecd7ad009cc5148c67b9d665f79a64083fae254:/ldisc.c diff --git a/ldisc.c b/ldisc.c index c77b5c8f..d569f112 100644 --- a/ldisc.c +++ b/ldisc.c @@ -12,12 +12,12 @@ #include "terminal.h" #include "ldisc.h" -#define ECHOING (ldisc->cfg->localecho == LD_YES || \ - (ldisc->cfg->localecho == LD_BACKEND && \ +#define ECHOING (ldisc->cfg->localecho == FORCE_ON || \ + (ldisc->cfg->localecho == AUTO && \ (ldisc->back->ldisc(ldisc->backhandle, LD_ECHO) || \ term_ldisc(ldisc->term, LD_ECHO)))) -#define EDITING (ldisc->cfg->localedit == LD_YES || \ - (ldisc->cfg->localedit == LD_BACKEND && \ +#define EDITING (ldisc->cfg->localedit == FORCE_ON || \ + (ldisc->cfg->localedit == AUTO && \ (ldisc->back->ldisc(ldisc->backhandle, LD_EDIT) || \ term_ldisc(ldisc->term, LD_EDIT)))) @@ -87,6 +87,19 @@ void *ldisc_create(Config *mycfg, Terminal *term, return ldisc; } +void ldisc_free(void *handle) +{ + Ldisc ldisc = (Ldisc) handle; + + if (ldisc->term) + ldisc->term->ldisc = NULL; + if (ldisc->back) + ldisc->back->provide_ldisc(ldisc->backhandle, NULL); + if (ldisc->buf) + sfree(ldisc->buf); + sfree(ldisc); +} + void ldisc_send(void *handle, char *buf, int len, int interactive) { Ldisc ldisc = (Ldisc) handle;