summaryrefslogtreecommitdiffstats
path: root/recipes/mc/mc-4.6.2/00-75-utf8-cmdline-help.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/mc/mc-4.6.2/00-75-utf8-cmdline-help.patch')
-rw-r--r--recipes/mc/mc-4.6.2/00-75-utf8-cmdline-help.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/recipes/mc/mc-4.6.2/00-75-utf8-cmdline-help.patch b/recipes/mc/mc-4.6.2/00-75-utf8-cmdline-help.patch
new file mode 100644
index 0000000000..5f1227d30a
--- /dev/null
+++ b/recipes/mc/mc-4.6.2/00-75-utf8-cmdline-help.patch
@@ -0,0 +1,63 @@
+Fix formatting the output of "mc --help".
+
+================================================================================
+--- mc-4.6.2/src/main.c
++++ mc-4.6.2/src/main.c
+@@ -1865,7 +1865,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.2/src/popthelp.c
++++ mc-4.6.2/src/popthelp.c
+@@ -101,7 +101,7 @@
+ goto out;
+ }
+
+- helpLength = strlen(help);
++ helpLength = mbstrlen(help);
+ while (helpLength > lineLength) {
+ ch = help + lineLength - 1;
+ while (ch > help && !isspace((unsigned char) *ch)) ch--;
+@@ -112,7 +112,7 @@
+ fprintf(f, "%.*s\n%*s", (int) (ch - help), help, indentLength, " ");
+ help = ch;
+ while (isspace((unsigned char) *help) && *help) help++;
+- helpLength = strlen(help);
++ helpLength = mbstrlen(help);
+ }
+
+ if (helpLength) fprintf(f, "%s\n", help);
+@@ -233,7 +233,7 @@
+ if (len == 3) return cursor;
+
+ if (argDescrip)
+- len += strlen(argDescrip) + 1;
++ len += mbstrlen(argDescrip) + 1;
+
+ if ((cursor + len) > 79) {
+ fprintf(f, "\n ");
+@@ -304,7 +304,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.2/src/util.c
++++ mc-4.6.2/src/util.c
+@@ -152,7 +152,7 @@
+ int columns = 0;
+ int i;
+ #ifdef UTF8
+- if (SLsmg_Is_Unicode) {
++ if (1) {
+ static mbstate_t s;
+ while (columns < col) {
+ memset (&s, 0, sizeof (s));