diff -Nru mksh-59c/debian/changelog mksh-59c/debian/changelog --- mksh-59c/debian/changelog 2021-05-31 00:42:55.000000000 +0000 +++ mksh-59c/debian/changelog 2021-07-10 20:08:30.000000000 +0000 @@ -1,3 +1,21 @@ +mksh (59c-9) unstable; urgency=medium + + * Cherry-pick bugfixes from CVS HEAD: + - stop referring to dead IRC network + - check lower bounds of input line array when backspacing + - protect against hi-bit7 (stty) EOF character + - show error message and exit nōn-zero on stdout write failure + for builtin calls (Closes: #990265) + display correct errno + - show error message in echo/print builtin on output write failure + (it exits 1 already in that case) + - ensure macro calls don’t have side effects in arguments + - properly flush stderr and unwind for direct builtin calls + (“ln -s /bin/mksh echo; ./echo …”) + - fix truncation behaviour for internal snprintf equivalent + * Update upstream contact info accordingly + + -- Thorsten Glaser Sat, 10 Jul 2021 22:08:30 +0200 + mksh (59c-8) unstable; urgency=medium * Fix a -Wpointer-sign in escaping code diff -Nru mksh-59c/debian/patches/debian-changes mksh-59c/debian/patches/debian-changes --- mksh-59c/debian/patches/debian-changes 2021-05-31 00:42:55.000000000 +0000 +++ mksh-59c/debian/patches/debian-changes 2021-07-10 20:08:30.000000000 +0000 @@ -106,6 +106,24 @@ exit 0 : <<'EOD' +--- mksh-59c.orig/FAQ2HTML.sh ++++ mksh-59c/FAQ2HTML.sh +@@ -1,5 +1,5 @@ + #!/bin/sh +-rcsid='$MirOS: src/bin/mksh/FAQ2HTML.sh,v 1.2 2020/10/31 04:17:36 tg Exp $' ++rcsid='$MirOS: src/bin/mksh/FAQ2HTML.sh,v 1.3 2021/06/15 01:09:43 tg Exp $' + #- + # Copyright © 2020 + # mirabilos +@@ -109,7 +109,7 @@ cat <*/--> + +-

Note: Links marked like this ++

Note: Links marked like this + one to the mksh IRC channel connect to external resources.

+

Notice: the website will have the latest version of the --- mksh-59c.orig/check.t +++ mksh-59c/check.t @@ -1,9 +1,9 @@ @@ -125,7 +143,7 @@ expected-stdout: - KSH R59 2020/10/31 -+ KSH R59 2021/05/30 ++ KSH R59 2021/07/10 description: Check base version of full shell stdin: @@ -353,7 +371,85 @@ expected-stdout: hi expected-stderr-pattern: /.*/ -@@ -8878,7 +8890,7 @@ expected-stderr-pattern: +@@ -7884,6 +7896,77 @@ expected-stdout: + G 12 + H 0 + --- ++name: exit-stdout-1 ++description: ++ cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990265, Austin ML ++stdin: ++ if test -c /dev/full && test -w /dev/full; then ++ if pwd >/dev/full 2>e; then ++ cat e ++ echo fail ++ else ++ echo pass ++ fi ++ else ++ echo skip ++ fi ++ case " $(echo $( (set -o posix) >/dev/null 2>&1 && set -o posix >/dev/null 2>&1; kill -l)) " in ++ (*' PIPE '*) ++ :>s ++ { trap '' PIPE; sleep 1; pwd 2>e; echo $? >s; } | : ++ case x$(cat s) in ++ (x) ++ cat e ++ echo fail else ;; ++ (x0) ++ cat e ++ echo fail 0 ;; ++ (*) ++ echo pass ;; ++ esac ++ ;; ++ (*) ++ echo skip ;; ++ esac ++expected-stdout-pattern: ++ /^(pass|skip)\n(pass|skip)\n$/ ++--- ++name: exit-stdout-2 ++description: ++ same, except for external utility / direct builtin call ++stdin: ++ ln -s "$__progname" pwd || cp "$__progname" pwd ++ if test -c /dev/full && test -w /dev/full; then ++ if ./pwd >/dev/full 2>e; then ++ cat e ++ echo fail ++ else ++ echo pass ++ fi ++ else ++ echo skip ++ fi ++ case " $(echo $( (set -o posix) >/dev/null 2>&1 && set -o posix >/dev/null 2>&1; kill -l)) " in ++ (*' PIPE '*) ++ :>s ++ { trap '' PIPE; sleep 1; ./pwd 2>e; echo $? >s; } | : ++ case x$(cat s) in ++ (x) ++ cat e ++ echo fail else ;; ++ (x0) ++ cat e ++ echo fail 0 ;; ++ (*) ++ echo pass ;; ++ esac ++ ;; ++ (*) ++ echo skip ;; ++ esac ++expected-stdout-pattern: ++ /^(pass|skip)\n(pass|skip)\n$/ ++--- + name: exit-trap-1 + description: + Check that "exit" with no arguments behaves SUSv4 conformant. +@@ -8878,7 +8961,7 @@ expected-stderr-pattern: --- name: utf8opt-1 description: @@ -362,7 +458,7 @@ env-setup: !PS1=!PS2=!LC_CTYPE=@utflocale@! stdin: if [[ $- = *U* ]]; then -@@ -8887,7 +8899,7 @@ stdin: +@@ -8887,7 +8970,7 @@ stdin: echo is not set fi expected-stdout: @@ -371,7 +467,7 @@ --- name: utf8opt-2 description: -@@ -9921,13 +9933,19 @@ stdin: +@@ -9921,13 +10004,19 @@ stdin: print -r -- "s=\"$s\"" eval "$s" typeset -p u v w @@ -393,7 +489,7 @@ --- name: varexpand-special-quote-faux-EBCDIC description: -@@ -13218,6 +13236,41 @@ expected-stdout: +@@ -13218,6 +13307,41 @@ expected-stdout: 2=\x7Cfoo-e \x4B 3=\x7Cfoo-e \x4B --- @@ -435,7 +531,7 @@ name: utilities-getopts-1 description: getopts sets OPTIND correctly for unparsed option -@@ -13740,8 +13793,14 @@ stdin: +@@ -13740,8 +13864,14 @@ stdin: done s+=$'\xC2\xA0\xE2\x82\xAC\xEF\xBF\xBD\xEF\xBF\xBE\xEF\xBF\xBF\xF0\x90\x80\x80.' typeset -p s @@ -1072,7 +1168,38 @@ } static void -@@ -2035,7 +2094,7 @@ x_match(const char *str, const char *pat +@@ -1618,7 +1677,7 @@ static char * + x_bs0(char *cp, char *lower_bound) + { + if (UTFMODE) +- while ((!lower_bound || (cp > lower_bound)) && ++ while ((cp > lower_bound) && + ((rtt2asc(*cp) & 0xC0) == 0x80)) + --cp; + return (cp); +@@ -1629,7 +1688,7 @@ x_bs3(char **p) + { + int i; + +- *p = x_bs0((*p) - 1, NULL); ++ *p = x_bs0((*p) - 1, xbuf); + i = x_size2(*p, NULL); + while (i--) + x_e_putc2('\b'); +@@ -1784,10 +1843,11 @@ x_newline(int c MKSH_A_UNUSED) + static int + x_end_of_text(int c MKSH_A_UNUSED) + { +- unsigned char tmp[1], *cp = tmp; ++ unsigned char tmp[2], *cp = tmp; + + *tmp = isedchar(edchars.eof) ? (unsigned char)edchars.eof : + (unsigned char)CTRL_D; ++ tmp[1] = '\0'; + x_zotc3((char **)&cp); + x_putc('\r'); + x_putc('\n'); +@@ -2035,7 +2095,7 @@ x_match(const char *str, const char *pat if (*pat == '^') { return ((strncmp(str, pat + 1, strlen(pat + 1)) == 0) ? 0 : -1); } else { @@ -1081,7 +1208,7 @@ return ((q == NULL) ? -1 : q - str); } } -@@ -2079,6 +2138,11 @@ static int +@@ -2079,6 +2139,11 @@ static int x_cls(int c MKSH_A_UNUSED) { shf_puts(MKSH_CLS_STRING, shl_out); @@ -1093,7 +1220,7 @@ x_redraw(0); return (KSTD); } -@@ -2094,12 +2158,14 @@ x_clrtoeol(int lastch, bool line_was_cle +@@ -2094,12 +2159,14 @@ x_clrtoeol(int lastch, bool line_was_cle { int col; @@ -1113,7 +1240,7 @@ col = x_col; while (col < (xx_cols - 2)) { -@@ -2840,11 +2906,13 @@ do_complete( +@@ -2840,11 +2907,13 @@ do_complete( x_adjust(); /* * append a space if this is a single non-directory match @@ -1131,7 +1258,7 @@ } x_free_words(nwords, words); -@@ -3149,12 +3217,12 @@ x_edit_line(int c MKSH_A_UNUSED) +@@ -3149,12 +3218,12 @@ x_edit_line(int c MKSH_A_UNUSED) /*- * NAME: @@ -1147,7 +1274,7 @@ * start of the previous command is used. * As a side effect, trashes the mark in order to achieve * being called in a repeatable fashion. -@@ -3192,13 +3260,13 @@ x_prev_histword(int c MKSH_A_UNUSED) +@@ -3192,13 +3261,13 @@ x_prev_histword(int c MKSH_A_UNUSED) rcp = &cp[strlen(cp) - 1]; /* @@ -1165,7 +1292,7 @@ rcp++; x_ins(rcp); } else { -@@ -3207,18 +3275,18 @@ x_prev_histword(int c MKSH_A_UNUSED) +@@ -3207,18 +3276,18 @@ x_prev_histword(int c MKSH_A_UNUSED) rcp = cp; /* @@ -1189,7 +1316,7 @@ rcp++; ch = *rcp; *rcp = '\0'; -@@ -3236,21 +3304,42 @@ x_prev_histword(int c MKSH_A_UNUSED) +@@ -3236,21 +3305,42 @@ x_prev_histword(int c MKSH_A_UNUSED) static int x_fold_upper(int c MKSH_A_UNUSED) { @@ -1235,7 +1362,7 @@ } /*- -@@ -3259,13 +3348,13 @@ x_fold_capitalise(int c MKSH_A_UNUSED) +@@ -3259,13 +3349,13 @@ x_fold_capitalise(int c MKSH_A_UNUSED) * * DESCRIPTION: * This function is used to implement M-U/M-u, M-L/M-l, M-C/M-c @@ -1251,7 +1378,7 @@ { char *cp = xcp; -@@ -3277,7 +3366,7 @@ x_fold_case(int c) +@@ -3277,7 +3367,7 @@ x_fold_case(int c) /* * first skip over any white-space */ @@ -1260,7 +1387,7 @@ cp++; /* * do the first char on its own since it may be -@@ -3295,7 +3384,7 @@ x_fold_case(int c) +@@ -3295,7 +3385,7 @@ x_fold_case(int c) /* * now for the rest of the word */ @@ -1269,7 +1396,7 @@ if (c == 'U') /* uppercase */ *cp = ksh_toupper(*cp); -@@ -5471,11 +5560,14 @@ complete_word(int cmd, int count) +@@ -5471,11 +5561,14 @@ complete_word(int cmd, int count) /* * append a space if this is a non-directory match @@ -1425,6 +1552,19 @@ } #endif tp->flag = (tp->flag & ~FINUSE) | old_inuse; +@@ -1388,7 +1397,11 @@ call_builtin(struct tbl *tp, const char + shl_stdout_ok = true; + ksh_getopt_reset(&builtin_opt, GF_ERROR); + rv = (*tp->val.f)(wp); +- shf_flush(shl_stdout); ++ if (shf_flush(shl_stdout) < 0) { ++ bi_errorf(Tf_sD_s, Twrite, cstrerror(errno)); ++ if (rv == 0) ++ rv = 1; ++ } + shl_stdout_ok = false; + builtin_argv0 = NULL; + builtin_spec = false; --- mksh-59c.orig/funcs.c +++ mksh-59c/funcs.c @@ -38,7 +38,7 @@ @@ -1458,7 +1598,25 @@ #ifdef __OS2__ {Textproc, c_true}, #endif -@@ -2757,11 +2749,6 @@ test_isop(Test_meta meta, const char *s) +@@ -562,6 +554,7 @@ c_print(const char **wp) + po.copipe = block_pipe(); + continue; + } ++ bi_errorf(Tf_sD_s, Twrite, cstrerror(errno)); + c = 1; + break; + } +@@ -1142,7 +1135,8 @@ c_kill(const char **wp) + n = 1; + while (n < ksh_NSIG) { + shf_puts(sigtraps[n].name, shl_stdout); +- shf_putc(++n == ksh_NSIG ? '\n' : ' ', ++ ++n; ++ shf_putc(n == ksh_NSIG ? '\n' : ' ', + shl_stdout); + } + } else { +@@ -2757,11 +2751,6 @@ test_isop(Test_meta meta, const char *s) #define test_lstat(name,buffer) lstat((name), (buffer)) #endif @@ -1470,7 +1628,7 @@ static int mtimecmp(const struct stat *sb1, const struct stat *sb2) { -@@ -2769,7 +2756,7 @@ mtimecmp(const struct stat *sb1, const s +@@ -2769,7 +2758,7 @@ mtimecmp(const struct stat *sb1, const s return (-1); if (sb1->st_mtime > sb2->st_mtime) return (1); @@ -1479,7 +1637,7 @@ if (sb1->st_mtimensec < sb2->st_mtimensec) return (-1); if (sb1->st_mtimensec > sb2->st_mtimensec) -@@ -3276,167 +3263,6 @@ c_realpath(const char **wp) +@@ -3276,167 +3265,6 @@ c_realpath(const char **wp) return (rv); } @@ -1701,6 +1859,45 @@ } static Lex_state * +--- mksh-59c.orig/lksh.1 ++++ mksh-59c/lksh.1 +@@ -1,4 +1,4 @@ +-.\" $MirOS: src/bin/mksh/lksh.1,v 1.26 2020/09/04 22:37:01 tg Exp $ ++.\" $MirOS: src/bin/mksh/lksh.1,v 1.28 2021/06/15 13:20:05 tg Exp $ + .\"- + .\" Copyright (c) 2008, 2009, 2010, 2012, 2013, 2015, 2016, 2017, 2018 + .\" mirabilos +@@ -81,7 +81,7 @@ + .\" with -mandoc, it might implement .Mx itself, but we want to + .\" use our own definition. And .Dd must come *first*, always. + .\" +-.Dd $Mdocdate: September 4 2020 $ ++.Dd $Mdocdate: June 15 2021 $ + .\" + .\" Check which macro package we use, and do other -mdoc setup. + .\" +@@ -346,16 +346,12 @@ Talk to the + .Mx + development team and users using the mailing list at + .Aq Mt miros\-mksh@mirbsd.org +-(please note the EU-DSGVO/GDPR notice on +-.Pa http://www.mirbsd.org/rss.htm#lists +-and in the SMTP banner!) or the ++or in the + .Li \&#\&!/bin/mksh +-.Pq or Li \&#ksh +-IRC channel at +-.Pa irc.freenode.net +-.Pq Port 6697 SSL, 6667 unencrypted +-if you need any further quirks or assistance, +-and consider migrating your legacy scripts to work with ++IRC channel; mind the infos from ++.Pa http://www.mirbsd.org/mksh\-faq.htm#contact ++for either. ++Consider migrating your legacy scripts to work with + .Nm mksh + instead of requiring + .Nm . --- mksh-59c.orig/main.c +++ mksh-59c/main.c @@ -6,7 +6,7 @@ @@ -1764,7 +1961,17 @@ /* unknown values */ default: utf_flag = 0; -@@ -2127,16 +2127,16 @@ void +@@ -738,6 +738,9 @@ main(int argc, const char *argv[]) + if ((rv = main_init(argc, argv, &s, &l)) == 0) { + if (as_builtin) { + rv = c_builtin(l->argv); ++ exstat = rv & 0xFF; ++ unwind(LEXIT); ++ /* NOTREACHED */ + } else { + shell(s, 0); + /* NOTREACHED */ +@@ -2127,16 +2130,16 @@ void recheck_ctype(void) { const char *ccp; @@ -1783,7 +1990,7 @@ #if HAVE_LANGINFO_CODESET if (!isuc(ccp)) ccp = nl_langinfo(CODESET); -@@ -2144,8 +2144,5 @@ recheck_ctype(void) +@@ -2144,8 +2147,5 @@ recheck_ctype(void) if (isuc(ccp)) UTFMODE = 1; #endif @@ -2211,7 +2418,7 @@ +++ mksh-59c/mksh.1 @@ -1,9 +1,9 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.494 2020/10/01 22:39:57 tg Exp $ -+.\" $MirOS: src/bin/mksh/mksh.1,v 1.506+locale-tracking 2021/02/26 11:51:08 tg Exp $ ++.\" $MirOS: src/bin/mksh/mksh.1,v 1.507+1.512+locale-tracking 2021/05/02 16:57:53 tg Exp $ .\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, @@ -2226,7 +2433,7 @@ .\" use our own definition. And .Dd must come *first*, always. .\" -.Dd $Mdocdate: October 1 2020 $ -+.Dd $Mdocdate: May 2 2021 $ ++.Dd $Mdocdate: July 10 2021 $ .\" .\" Check which macro package we use, and do other -mdoc setup. .\" @@ -2694,20 +2901,40 @@ .Sh BUGS Suspending (using \*(haZ) pipelines like the one below will only suspend the currently running part of the pipeline; in this example, -@@ -7089,7 +7139,7 @@ for the in-memory portion of the history +@@ -7089,9 +7139,9 @@ for the in-memory portion of the history .Xr memmove 3 . .Pp This document attempts to describe -.Nm mksh\ R59c +.Nm mksh\ R59-CURRENT and up, - .\" with vendor patches from insert-your-name-here, +-.\" with vendor patches from insert-your-name-here, ++with vendor patches from Debian, compiled without any options impacting functionality, such as + .Dv MKSH_SMALL , + when not called as +@@ -7107,13 +7157,7 @@ Please report bugs in + .Nm + to the public development mailing list at + .Aq Mt miros\-mksh@mirbsd.org +-(please note the EU-DSGVO/GDPR notice on +-.Pa http://www.mirbsd.org/rss.htm#lists +-and in the SMTP banner!) or in the ++or, in the + .Li \&#\&!/bin/mksh +-.Pq or Li \&#ksh +-IRC channel at +-.Pa irc.freenode.net +-.Pq Port 6697 SSL, 6667 unencrypted , +-or at: +-.Pa https://launchpad.net/mksh ++channel, on IRC; for both, note the information at: ++.Pa http://www.mirbsd.org/mksh\-faq.htm#contact --- mksh-59c.orig/mksh.faq +++ mksh-59c/mksh.faq @@ -1,4 +1,4 @@ -RCSID: $MirOS: src/bin/mksh/mksh.faq,v 1.10 2020/10/01 22:59:12 tg Exp $ -+RCSID: $MirOS: src/bin/mksh/mksh.faq,v 1.19+locale-tracking 2021/05/02 08:26:03 tg Exp $ ++RCSID: $MirOS: src/bin/mksh/mksh.faq,v 1.23+locale-tracking 2021/07/10 17:39:27 tg Exp $ ToC: spelling Title: How do you spell mksh? How do you pronounce it? @@ -2730,6 +2957,17 @@ ---- ToC: sowhatismksh Title: I’m a $OS (Android, OS/2, …) user, so what’s mksh? +@@ -98,8 +101,8 @@ Title: How does this relate to ksh or th + getting close to, ksh88 compatibility.

+

SKsh is an AmigaOS-specific Korn Shell-lookalike by Steve Koren.

+

The Homepage of the #ksh +- channel on Freenode IRC contains more information about the Korn +- Shell in general and its flavours.

++ channel on IRC contains more information about the Korn Shell in ++ general and its flavours.

+ ---- + ToC: packaging + Title: How should I package mksh? (common cases) @@ -260,7 +263,7 @@ Title: My prompt is weird! (This was agreed upon as suggestion in a discussion between bash, zsh and Korn shell developers.) The feature set of different shells vastly differs @@ -2780,7 +3018,35 @@ ---- ToC: ctrl-x-e Title: Multiline command editing -@@ -329,9 +355,15 @@ Use ^[^L (Escape+Ctrl-L) or rebind it:really useful to write ad-hōc scripts as well.

+ ---- ++ToC: escaping ++Title: Some characters don’t display right ++ ++

First, make sure that either you’re using a UTF-8 terminal and system ++ and the shell’s UTF-8 mode is on (set -U) or that you’re using ++ an 8-bit codepage/CCSID and the UTF-8 mode is off (set +U). If ++ you’re on an EBCDIC system ensure to pick a codepage that has a bijective ++ mapping to (Extended) ASCII and in which all necessary characters are ++ present, for example 1047. Furthermore ensure the compile-time and runtime ++ codepages match. (Other encoding schemes, e.g. DBCS or ISO-2022-JP, are ++ not supported.) This should already fix most relevant issues.

++

If using an 8-bit coding system that (unlike e.g. ISO 8859 or EBCDIC) ++ does not assign control characters to “Extended ASCII” codepoints 0x80‥0x9F, ++ such as codepages 437, 850, 1252, … (usually on OS/2 or DOS-based systems), ++ enable the option set -o asis (new in R60); otherwise, they will ++ be escaped to avoid accidentally setting off terminal control sequences.

++

Note that escaping of characters is, at runtime, dependent on whether the ++ shell was compiled for EBCDIC and/or utf8-mode and/or asis ++ are enabled, the latter being ignored if either of the former two are true ++ (in UTF-8 mode, UCS C1 codepoints are always escaped).

++---- + ToC: ctrl-l-cls + Title: ^L (Ctrl-L) does not clear the screen + +@@ -329,9 +376,15 @@ Use ^[^L (Escape+Ctrl-L) or rebind it:evaluate-region @@ -2806,7 +3072,7 @@ implement a programmable completion engine. Multiple people have been considering doing so in our IRC channel; we’ll hyperlink to these engines when they are available. -@@ -398,7 +430,12 @@ Title: How POSIX compliant is mksh? Also +@@ -398,7 +451,12 @@ Title: How POSIX compliant is mksh? Also utf8-mode (which only supports the BMP (Basic Multilingual Plane) of UCS and maps raw octets into the U+EF80‥U+EFFF wide character range; see Arithmetic expressions in mksh(1) for details) must stay @@ -2820,7 +3086,7 @@

The following POSIX sh-compatible code toggles the utf8-mode option dependent on the current POSIX locale, for mksh to allow using the UTF-8 mode, within the constraints outlined above, in -@@ -414,7 +451,7 @@ Title: How POSIX compliant is mksh? Also +@@ -414,7 +472,7 @@ Title: How POSIX compliant is mksh? Also esac

In near future, (UTF-8) locale tracking will @@ -2829,7 +3095,7 @@

The shell is pretty close to POSIX, when run as lksh -o posix under the "C" locale it is intended to match. It does not do everything like other POSIX-compatible or ‑compliant shells, though.

-@@ -532,6 +569,15 @@ This is because AT&T ksh93 ships a p +@@ -532,6 +590,15 @@ This is because AT&T ksh93 ships a p put this into your ~/.mkshrc (note the space before the closing single quote) ---- @@ -2845,7 +3111,7 @@ ToC: builtin-rename Title: “rename” doesn’t work as expected! -@@ -546,23 +592,39 @@ Title: “rename” doesn’t work as ex +@@ -546,23 +613,39 @@ Title: “rename” doesn’t work as ex
alias rename="$(whence -p rename)"
---- ToC: builtin-sleep @@ -2901,6 +3167,40 @@ ---- ToC: string-concat Title: “+=” behaves differently from other shells +@@ -635,18 +718,22 @@ Title: I use “set -eo pipefail” and + ToC: faq + Title: My question is not answered here! + +-Do read the mksh(1) manual page. You might also wish to read the homepage of the #ksh IRC channel +-on Freenode which lists several resources for Korn or POSIX-compatible +-shells in general. Or, contact us (developer and +-users), for example via IRC. ++Do read the mksh(1) and lksh(1) manual page. You might also wish to read the homepage of the #ksh IRC channel ++which lists several resources for Korn or POSIX-compatible shells in general. ++Or, contact us (developer and users). + ---- + ToC: contact +-Title: How do I contact you (to say thanks)? ++Title: How do I contact you (to say thanks, for bugreports and questions)? + +-You can say hi in the #!/bin/mksh channel on Freenode IRC, although a donation wouldn’t be amiss ☺ The mailing +-list can also be used. ++

You can say hi in the #!/bin/mksh channel on IRC (OFTC, for now), although… a ++ donation wouldn’t be amiss ☻ ++
The mailing list can also ++ be used for this. The extra resources from the FAQ ++ entry just one above should also be considered ;-)

++

If you insist on sending a bugreport, IRC and the mailing list are ++ great places for that; Launchpad, ++ an external gratis service provided by a company, can also be used if you ++ like web-based issue trackers better.

+ ---- --- mksh-59c.orig/rlimits.opt +++ mksh-59c/rlimits.opt @@ -1,5 +1,5 @@ @@ -2939,7 +3239,7 @@ +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.906 2021/01/24 19:37:31 tg Exp $"); #endif -#define MKSH_VERSION "R59 2020/10/31" -+#define MKSH_VERSION "R59 2021/05/30" ++#define MKSH_VERSION "R59 2021/07/10" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES @@ -3043,7 +3343,42 @@ FN("bgnice", FBGNICE, OF_ANY --- mksh-59c.orig/shf.c +++ mksh-59c/shf.c -@@ -1206,7 +1206,7 @@ const uint32_t tpl_ctypes[128] = { +@@ -383,6 +383,8 @@ shf_emptybuf(struct shf *shf, int flags) + memmove(shf->buf, buf, + ntowrite); + shf->wp = shf->buf + ntowrite; ++ /* restore errno for caller */ ++ errno = shf->errnosv; + } + return (-1); + } +@@ -681,8 +683,13 @@ shf_write(const char *buf, ssize_t nbyte + if (shf->flags & SHF_STRING) { + /* resize buffer until there's enough space left */ + while (nbytes > shf->wnleft) +- if (shf_emptybuf(shf, EB_GROW) == -1) +- return (-1); ++ if (shf_emptybuf(shf, EB_GROW) == -1) { ++ /* truncate if possible */ ++ if (shf->wnleft == 0) ++ return (-1); ++ nbytes = shf->wnleft; ++ break; ++ } + /* then write everything into the buffer */ + } else { + /* flush deals with sticky errors */ +@@ -1063,8 +1070,7 @@ shf_vfprintf(struct shf *shf, const char + + nwritten += precision; + precision = utf_skipcols(s, precision, &tmp) - s; +- while (precision--) +- shf_putc(*s++, shf); ++ shf_write(s, precision, shf); + + nwritten += field; + while (field--) +@@ -1206,7 +1212,7 @@ const uint32_t tpl_ctypes[128] = { CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiLOWER, CiCURLY, diff -Nru mksh-59c/debian/README.Debian mksh-59c/debian/README.Debian --- mksh-59c/debian/README.Debian 2021-05-31 00:40:08.000000000 +0000 +++ mksh-59c/debian/README.Debian 2021-07-10 20:06:04.000000000 +0000 @@ -16,12 +16,12 @@ they may be ignored and closed if reported as Debian bugs. The contact info for upstream is: -* #!/bin/mksh (or #ksh) IRC channel - at irc.freenode.net (Port 6697 SSL, 6667 unencrypted) +* #!/bin/mksh IRC channel + at irc.oftc.net (Port 6697 SSL, 6667 unencrypted) currently * mksh mailing list (does not require subscription to post) - archived at http://news.gmane.org/gmane.os.miros.mksh and others + as GMane ended, there is no public archive any more, unfortunately (note: several freemail providers have issues with the list; use GMane (NNTP or web interface) to post in those cases) diff -Nru mksh-59c/debian/upstream/metadata mksh-59c/debian/upstream/metadata --- mksh-59c/debian/upstream/metadata 2021-05-31 00:40:08.000000000 +0000 +++ mksh-59c/debian/upstream/metadata 2021-07-10 19:36:32.000000000 +0000 @@ -4,7 +4,7 @@ "Bug-Submit": "mailto:miros-mksh@mirbsd.org", "Changelog": "http://www.mirbsd.org/mksh.htm#clog", "Cite-As": "The MirBSD Korn Shell (mksh)", - "Contact": "irc://irc.freenode.net/!%2Fbin%2Fmksh", + "Contact": "irc://irc.oftc.net/!%2Fbin%2Fmksh", "Documentation": "http://www.mirbsd.org/MirOS/dist/mir/mksh/mksh.pdf", "Donation": "http://www.mirbsd.org/danke.htm", "FAQ": "http://www.mirbsd.org/mksh-faq.htm",