/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

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.344 2009/11/28 14:21:41 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.345 2009/11/28 14:27:58 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -6699,12 +6699,8 @@ description:
Check some corner cases
stdin:
print % $% .
set -U
x='a b'
print c ${%x} .
expected-stdout:
% $% .
c -1 .
---
name: wcswidth-3
description:

7
eval.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.75 2009/11/28 14:21:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.76 2009/11/28 14:27:59 tg Exp $");
/*
* string expansion
@ -949,13 +949,12 @@ varsub(Expand *xp, const char *sp, const char *word,
} else {
p = str_val(global(sp));
zero_ok = p != null;
c = stype == '#' ? (int)utflen(p) :
utf_mbswidth(p, false);
c = stype == '#' ? (int)utflen(p) : utf_mbswidth(p);
}
if (Flag(FNOUNSET) && c == 0 && !zero_ok)
errorf("%s: parameter not set", sp);
*stypep = 0; /* unqualified variable/string substitution */
xp->str = shf_smprintf("%d", c);
xp->str = shf_smprintf("%u", (unsigned int)c);
return (XSUB);
}

6
exec.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.69 2009/11/28 14:21:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.70 2009/11/28 14:28:00 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, const char **,
int volatile, volatile int *);
@ -1380,7 +1380,7 @@ pr_menu(const char * const *ap)
i = strlen(*pp);
if (i > aocts)
aocts = i;
i = utf_mbswidth(*pp, true);
i = utf_mbswidth(*pp);
if (i > acols)
acols = i;
}
@ -1420,7 +1420,7 @@ pr_list(char * const *ap)
i = strlen(*pp);
if (i > aocts)
aocts = i;
i = utf_mbswidth(*pp, true);
i = utf_mbswidth(*pp);
if (i > acols)
acols = i;
}

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;

View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.143 2009/11/28 14:21:44 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.144 2009/11/28 14:28:01 tg Exp $");
#if HAVE_KILLPG
/*
@ -1551,7 +1551,7 @@ c_kill(const char **wp)
w = strlen(sigtraps[j].mess);
if (w > mess_octs)
mess_octs = w;
w = utf_mbswidth(sigtraps[j].mess, true);
w = utf_mbswidth(sigtraps[j].mess);
if (w > mess_cols)
mess_cols = w;
}

4
misc.c
View File

@ -29,7 +29,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.132 2009/11/28 14:21:45 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.133 2009/11/28 14:28:02 tg Exp $");
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
@ -154,7 +154,7 @@ printoptions(bool verbose)
len = strlen(options[i].name);
if (len > octs)
octs = len;
len = utf_mbswidth(options[i].name, true);
len = utf_mbswidth(options[i].name);
if (len > oi.opt_width)
oi.opt_width = len;
}

4
sh.h
View File

@ -134,7 +134,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.363 2009/11/28 14:21:45 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.364 2009/11/28 14:28:02 tg Exp $");
#endif
#define MKSH_VERSION "R39 2009/11/22"
@ -1361,7 +1361,7 @@ int v_evaluate(struct tbl *, const char *, volatile int, bool);
size_t utf_mbtowc(unsigned int *, const char *);
size_t utf_wctomb(char *, unsigned int);
int utf_widthadj(const char *, const char **);
int utf_mbswidth(const char *, bool);
int utf_mbswidth(const char *);
const char *utf_skipcols(const char *, int);
size_t utf_ptradj(const char *);
int utf_wcwidth(unsigned int);

4
shf.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.34 2009/11/28 14:21:46 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.35 2009/11/28 14:28:03 tg Exp $");
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */
@ -932,7 +932,7 @@ shf_vfprintf(struct shf *shf, const char *fmt, va_list args)
case 's':
if (!(s = va_arg(args, const char *)))
s = "(null)";
len = utf_mbswidth(s, true);
len = utf_mbswidth(s);
break;
case 'c':

4
var.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.97 2009/11/28 14:21:47 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.98 2009/11/28 14:28:03 tg Exp $");
/*
* Variables
@ -574,7 +574,7 @@ formatstr(struct tbl *vp, const char *s)
char *p, *q;
size_t psiz;
olen = utf_mbswidth(s, true);
olen = utf_mbswidth(s);
if (vp->flag & (RJUST|LJUST)) {
if (!vp->u2.field) /* default field width */