Fix formatting the output of "mc --help". ================================================================================ --- mc-4.6.1-pre2b/src/main.c +++ mc-4.6.1-pre2b/src/main.c @@ -1857,7 +1857,7 @@ /* print help for options */ leftColWidth = poptPrintHelp (ctx, stream, 0); - fprintf (stream, " %-*s %s\n", leftColWidth, _("+number"), + fprintf (stream, " %-*s %s\n", leftColWidth + strlen(_("+number")) - mbstrlen(_("+number")), _("+number"), _("Set initial line number for the internal editor")); fputs (_ ("\n" --- mc-4.6.1-pre2b/src/popthelp.c +++ mc-4.6.1-pre2b/src/popthelp.c @@ -93,7 +93,7 @@ goto out; } - helpLength = strlen(help); + helpLength = mbstrlen(help); while (helpLength > lineLength) { ch = help + lineLength - 1; while (ch > help && !isspace(*ch)) ch--; @@ -104,7 +104,7 @@ fprintf(f, "%.*s\n%*s", (int) (ch - help), help, indentLength, " "); help = ch; while (isspace(*help) && *help) help++; - helpLength = strlen(help); + helpLength = mbstrlen(help); } if (helpLength) fprintf(f, "%s\n", help); @@ -223,7 +223,7 @@ if (len == 3) return cursor; if (argDescrip) - len += strlen(argDescrip) + 1; + len += mbstrlen(argDescrip) + 1; if ((cursor + len) > 79) { fprintf(f, "\n "); @@ -292,7 +292,7 @@ singleTableUsage(f, cursor, con->options, NULL); if (con->otherHelp) { - cursor += strlen(con->otherHelp) + 1; + cursor += mbstrlen(con->otherHelp) + 1; if (cursor > 79) fprintf(f, "\n "); fprintf(f, " %s", con->otherHelp); } --- mc-4.6.1-pre2b/src/util.c +++ mc-4.6.1-pre2b/src/util.c @@ -127,7 +127,7 @@ mbstrlen (const char *str) { #ifdef UTF8 - if (SLsmg_Is_Unicode) { + if (1) { static mbstate_t s; int len; const char *str0 = str;