Hi folks,
Here is a patch to exec command through your favorite shell instead of
/bin/sh.
fvwm get the shell from the SHELL environment variable (if it found it) or put
/bin/sh as the default shell.
I tested it on my sun box solaris 2.4 (i use csh). it work fine for me.
Just a question how can i patch code from diff -ur command (on my solaris i
haven't this option) and patch hang to patch the code.
Here's the patch.
diff -c fvwm.c.orig fvwm.c
*** fvwm.c.orig Thu Mar 7 09:40:28 1996
--- fvwm.c Thu Mar 7 16:55:18 1996
***************
*** 46,51 ****
--- 46,53 ----
int master_pid; /* process number of 1st fvwm process
*/
+ char *exec_shell; /* SHELL environement variable */
+
ScreenInfo Scr; /* structures for the screen */
Display *dpy; /* which display are we talking to */
***************
*** 127,132 ****
--- 129,139 ----
g_argv = argv;
g_argc = argc;
+ if (getenv("SHELL") != NULL)
+ exec_shell = strdup(getenv("SHELL"));
+ else
+ exec_shell = strdup("/bin/sh");
+
DBUG("main","Entered, about to parse args");
for (i = 1; i < argc; i++)
diff -c fvwm.h.orig fvwm.h
*** fvwm.h.orig Mon Nov 6 20:36:04 1995
--- fvwm.h Thu Mar 7 17:00:52 1996
***************
*** 271,276 ****
--- 271,278 ----
extern int master_pid;
+ extern char *exec_shell;
+
extern Display *dpy;
extern XContext FvwmContext;
diff -c builtins.c.orig builtins.c
*** builtins.c.orig Thu Mar 7 09:24:07 1996
--- builtins.c Thu Mar 7 16:38:06 1996
***************
*** 624,630 ****
* The man page says that its better. */
/* Not everyone has vfork! */
if (!(fork())) /* child process */
! if (execl("/bin/csh", "/bin/csh", "-c", action, (char *)0)==-1)
exit(100);
return;
}
--- 624,630 ----
* The man page says that its better. */
/* Not everyone has vfork! */
if (!(fork())) /* child process */
! if (execl(exec_shell, exec_shell, "-c", action, (char *)0)==-1)
exit(100);
return;
}
It's all
Bye
Olivier
--
_\\|//_
( O-O )
---------------------------------ooO-(_)-Ooo-----------------------------------
FRANCE TELECOM - CENTRE NATIONAL d'ETUDES et DES TELECOMMUNICATIONS
Dugeon olivier X-400: G=Olivier; S=Dugeon; OU=LANNION
FT-CNET LAA/RSL/ATM P=CNET; A=ATLAS; C=FR;
Technopole Anticipa E-mail: dugeon_at_lannion.cnet.fr
2, Avenue Pierre Marzin Phone: +(33) 96 05 28 80
F-22307 LANNION Fax +(33) 96 05 11 98
FRANCE Telex: 740801F
--------------------------------ooO-------Ooo----------------------------------
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Fri Mar 08 1996 - 01:24:32 GMT