/me is annoyed

I read, IIRC in the Cederqvist, that 'cvs tag' sets a sticky tag onto
the cwd… it doesn’t, apparently. (I actually like it better this way,
but one needs to know!)
This commit is contained in:
tg
2009-11-28 14:28:03 +00:00
parent 883d9d99b3
commit a09f05e77a
9 changed files with 21 additions and 37 deletions

19
expr.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.38 2009/11/28 14:21:44 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.39 2009/11/28 14:28:00 tg Exp $");
/* The order of these enums is constrained by the order of opinfo[] */
enum token {
@ -683,15 +683,8 @@ utf_widthadj(const char *src, const char **dst)
return (width);
}
/**
* In lenient mode, characters of width -1 are handled as one column
* per octet (kind of as a strlen replacement). Users of lenient mo-
* de should reconsider the code.
* In strict mode, this behaves like wcswidth(3) and returns -1 upon
* encounter of a control multibyte character.
*/
int
utf_mbswidth(const char *s, bool lenient)
utf_mbswidth(const char *s)
{
size_t len;
unsigned int wc;
@ -701,14 +694,10 @@ utf_mbswidth(const char *s, bool lenient)
return (strlen(s));
while (*s)
if ((len = utf_mbtowc(&wc, s)) == (size_t)-1) {
by_octet:
if (((len = utf_mbtowc(&wc, s)) == (size_t)-1) ||
((cw = utf_wcwidth(wc)) == -1)) {
s++;
width += 1;
} else if ((cw = utf_wcwidth(wc)) == -1) {
if (lenient)
goto by_octet;
return (-1);
} else {
s += len;
width += cw;