File 0002-improved-subprocess-2.patch of Package ldapvi

From b86fc95ddfb9076e367ecf8e591f74a2b3b9c685 Mon Sep 17 00:00:00 2001
From: Ken Stailey <kstailey@yahoo.com>
Date: Fri, 27 May 2011 15:41:48 -0400
Subject: [PATCH 2/2] improved subprocess 2

Patch author: Anders Kaseorg
Patch E-mail list URL:
http://lists.askja.de/pipermail/ldapvi/2010-December/000087.html

This handles PAGER in the same way the last commit handled EDITOR.
---
 ldapvi/misc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ldapvi/misc.c b/ldapvi/misc.c
index 2e3a1f5..307e1ed 100644
--- a/ldapvi/misc.c
+++ b/ldapvi/misc.c
@@ -215,7 +215,8 @@ view(char *pathname)
 	case -1:
 		syserr();
 	case 0:
-		execlp(pg, pg, pathname, (char *) NULL);
+		execl("/bin/sh", "sh", "-c", "exec $0 \"$@\"", pg,
+		      pathname, (char *) NULL);
 		syserr();
 	}
 
@@ -247,7 +248,7 @@ pipeview(int *fd)
 		close(fds[1]);
 		dup2(fds[0], 0);
 		close(fds[0]);
-		execlp(pg, pg, (char *) NULL);
+		execl("/bin/sh", "sh", "-c", "exec $0", pg, (char *) NULL);
 		syserr();
 	}
 
-- 
1.7.6
openSUSE Build Service is sponsored by