From: kloczek Date: Sun, 1 Oct 2000 00:39:11 +0000 (+0000) Subject: - patch from RH. X-Git-Tag: less-358-8~1 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=f6bb244dc1a4dfb9929d2acf2e9cf928d70ad02a;p=packages%2Fless.git - patch from RH. Changed files: less-shell.patch -> 1.1 --- diff --git a/less-shell.patch b/less-shell.patch new file mode 100644 index 0000000..6653a72 --- /dev/null +++ b/less-shell.patch @@ -0,0 +1,62 @@ +--- less-358/filename.c.broken Wed Jul 26 20:42:36 2000 ++++ less-358/filename.c Wed Jul 26 20:43:14 2000 +@@ -514,53 +514,13 @@ + { + FILE *fd; + +-#if HAVE_SHELL +- char *shell; ++ fd = popen(cmd, "r"); ++ /* ++ * Redirection in `popen' might have messed with the ++ * standard devices. Restore binary input mode. ++ */ ++ SET_BINARY(0); + +- shell = lgetenv("SHELL"); +- if (shell != NULL && *shell != '\0') +- { +- char *scmd; +- char *esccmd; +- +- /* +- * Try to escape any metacharacters in the command. +- * If we can't do that, just put the command in quotes. +- * (But that doesn't work well if the command itself +- * contains quotes.) +- */ +- if ((esccmd = esc_metachars(cmd)) == NULL) +- { +- /* +- * Cannot escape the metacharacters, so use quotes. +- * Read the output of <$SHELL -c "cmd">. +- */ +- scmd = (char *) ecalloc(strlen(shell) + strlen(cmd) + 7, +- sizeof(char)); +- sprintf(scmd, "%s -c \"%s\"", shell, cmd); +- } else +- { +- /* +- * Read the output of <$SHELL -c cmd>. +- * No quotes; use the escaped cmd. +- */ +- scmd = (char *) ecalloc(strlen(shell) + strlen(esccmd) + 5, +- sizeof(char)); +- sprintf(scmd, "%s -c %s", shell, esccmd); +- free(esccmd); +- } +- fd = popen(scmd, "r"); +- free(scmd); +- } else +-#endif +- { +- fd = popen(cmd, "r"); +- /* +- * Redirection in `popen' might have messed with the +- * standard devices. Restore binary input mode. +- */ +- SET_BINARY(0); +- } + return (fd); + } +