[_WIN32] (loc_StripDels): Remove. Different behavior depending on the
platform is evil, and line editing is none of the server's business anyway. If your client can't deal with the delete key, well, here's a nickel, kid, get yourself a better computer.
This commit is contained in:
parent
95234c8e9f
commit
3a060d6056
1 changed files with 0 additions and 34 deletions
|
@ -169,9 +169,6 @@ ioq_gets(struct ioqueue *ioq, s_char *buf, int cc)
|
||||||
buf[actual] = '\0';
|
buf[actual] = '\0';
|
||||||
/* remove the newline too */
|
/* remove the newline too */
|
||||||
removecc(ioq, nbytes + 1);
|
removecc(ioq, nbytes + 1);
|
||||||
#if defined(_WIN32)
|
|
||||||
loc_StripDels(buf);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return nbytes;
|
return nbytes;
|
||||||
}
|
}
|
||||||
|
@ -420,34 +417,3 @@ ioq_makebuf(struct ioqueue *ioq, char *pBuf, int nBufLen)
|
||||||
return ncopied;
|
return ncopied;
|
||||||
}
|
}
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
/*
|
|
||||||
* Remove backspaces and DELs from the buffer.
|
|
||||||
*
|
|
||||||
* Why? Because I got tired of telneting into the
|
|
||||||
* server and having to type perfectly...
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
loc_StripDels(char *pBuf)
|
|
||||||
{
|
|
||||||
char *cp;
|
|
||||||
char *dp;
|
|
||||||
char *sp;
|
|
||||||
|
|
||||||
for (cp = pBuf; *cp;) {
|
|
||||||
/* Remove Backspace and DEL */
|
|
||||||
if (*cp == '\b' || *cp == '\x8F') {
|
|
||||||
if (cp == pBuf)
|
|
||||||
dp = cp;
|
|
||||||
else
|
|
||||||
dp = cp - 1;
|
|
||||||
sp = cp + 1;
|
|
||||||
while (*sp)
|
|
||||||
*dp++ = *sp++;
|
|
||||||
*dp = 0;
|
|
||||||
} else
|
|
||||||
cp++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue