[PATCH 06/31] more: use paths.h to find bourne shell and vi editor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 text-utils/more.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/text-utils/more.c b/text-utils/more.c
index 940d429..ba5459a 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -46,6 +46,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <paths.h>
 #include <regex.h>
 #include <setjmp.h>
 #include <signal.h>
@@ -83,8 +84,6 @@
 # define XTABS	TAB3
 #endif
 
-#define VI	"vi"	/* found on the user's path */
-
 #define Fopen(s, m)	(ctl->Currline = 0, ctl->file_pos=0, fopen(s,m))
 #define Ftell(f)	ctl->file_pos
 #define Fseek(f, off)	(ctl->file_pos=off, fseek(f, off, 0))
@@ -1578,7 +1577,7 @@ static int command(struct more_control *ctl, char *filename, register FILE *f)
 				if (editor == NULL || *editor == '\0')
 					editor = getenv("EDITOR");
 				if (editor == NULL || *editor == '\0')
-					editor = VI;
+					editor = _PATH_VI;
 
 				p = strrchr(editor, '/');
 				if (p)
@@ -1839,7 +1838,7 @@ static void initterm(struct more_control *ctl)
 
 		}
 		if ((ctl->shell = getenv("SHELL")) == NULL)
-			ctl->shell = "/bin/sh";
+			ctl->shell = _PATH_BSHELL;
 	}
 	ctl->no_intty = tcgetattr(fileno(stdin), &ctl->otty);
 	tcgetattr(fileno(stderr), &ctl->otty);
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux