]> git.pld-linux.org Git - packages/less.git/commitdiff
- patch from RH.
authorkloczek <kloczek@pld-linux.org>
Sun, 1 Oct 2000 00:39:11 +0000 (00:39 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    less-shell.patch -> 1.1

less-shell.patch [new file with mode: 0644]

diff --git a/less-shell.patch b/less-shell.patch
new file mode 100644 (file)
index 0000000..6653a72
--- /dev/null
@@ -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);
+ }
This page took 0.166834 seconds and 4 git commands to generate.