From a17f3b77caa22d4e9f42fa361ef20ca4706116d8 Mon Sep 17 00:00:00 2001 From: Kacper Kornet Date: Fri, 9 Mar 2012 17:53:12 +0000 Subject: [PATCH] - non-interactive mksh can inherit COLUMNS and LINES from parent process; fixes git-core-1.7.10-rc0 test suite Changed files: mksh-columns.patch -> 1.1 mksh.spec -> 1.38 --- mksh-columns.patch | 31 +++++++++++++++++++++++++++++++ mksh.spec | 4 +++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 mksh-columns.patch diff --git a/mksh-columns.patch b/mksh-columns.patch new file mode 100644 index 0000000..06c24dc --- /dev/null +++ b/mksh-columns.patch @@ -0,0 +1,31 @@ +diff -u -p -u -p -r1.522 sh.h +--- sh.h 3 Mar 2012 21:31:21 -0000 1.522 ++++ sh.h 9 Mar 2012 15:14:49 -0000 +@@ -855,7 +855,7 @@ EXTERN char *current_wd; + */ + #define MIN_COLS (2 + MIN_EDIT_SPACE + 3) + #define MIN_LINS 3 +-EXTERN mksh_ari_t x_cols E_INIT(80); /* tty columns */ ++EXTERN mksh_ari_t x_cols E_INIT(-1); /* tty columns */ + EXTERN mksh_ari_t x_lins E_INIT(-1); /* tty lines */ + + /* These to avoid bracket matching problems */ +diff -u -p -u -p -r1.141 var.c +--- var.c 3 Mar 2012 21:31:23 -0000 1.141 ++++ var.c 9 Mar 2012 15:14:49 -0000 +@@ -1458,14 +1458,13 @@ set_array(const char *var, bool reset, c + void + change_winsz(void) + { +- if (x_lins < 0) { ++ if (x_cols < 0 && x_lins < 0) { + /* first time initialisation */ + #ifdef TIOCGWINSZ + if (tty_fd < 0) + /* non-FTALKING, try to get an fd anyway */ + tty_init(true, false); + #endif +- x_cols = -1; + } + + #ifdef TIOCGWINSZ diff --git a/mksh.spec b/mksh.spec index 41aaf71..23fcbb0 100644 --- a/mksh.spec +++ b/mksh.spec @@ -5,7 +5,7 @@ Summary: MirBSD Korn Shell Summary(pl.UTF-8): Powłoka Korna z MirBSD Name: mksh Version: 40d -Release: 2 +Release: 3 License: BSD Group: Applications/Shells Source0: http://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.cpio.gz @@ -16,6 +16,7 @@ Patch1: %{name}-circumflex.patch Patch2: %{name}-no_stop_alias.patch Patch3: %{name}-distro.patch Patch4: %{name}-cmdline-length.patch +Patch5: %{name}-columns.patch URL: https://www.mirbsd.org/mksh.htm %if %{with tests} BuildRequires: ed @@ -86,6 +87,7 @@ mv mksh/* .; rmdir mksh %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p0 sed -i -e 's#@DISTRO@#PLD/Linux 3.0#g' check.t sh.h -- 2.44.0