summaryrefslogtreecommitdiffstats
path: root/gnu/libexec/uucp/libunix/cusub.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/libexec/uucp/libunix/cusub.c')
-rw-r--r--gnu/libexec/uucp/libunix/cusub.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/gnu/libexec/uucp/libunix/cusub.c b/gnu/libexec/uucp/libunix/cusub.c
index 3486c71..b1bce90 100644
--- a/gnu/libexec/uucp/libunix/cusub.c
+++ b/gnu/libexec/uucp/libunix/cusub.c
@@ -1,7 +1,7 @@
/* cusub.c
System dependent routines for cu.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char cusub_rcsid[] = "$Id: cusub.c,v 1.2 1994/05/07 18:10:14 ache Exp $";
+const char cusub_rcsid[] = "$Id: cusub.c,v 1.24 1995/06/21 19:18:53 ian Rel $";
#endif
#include "uudefs.h"
@@ -330,7 +330,7 @@ fsysdep_cu (qconn, pbcmd, zlocalname)
if (c <= 0)
break;
- if (fstart && b == *zCuvar_escape)
+ if (fstart && b == *zCuvar_escape && b != '\0')
{
c = cscu_escape (pbcmd, zlocalname);
if (c <= 0)
@@ -410,7 +410,7 @@ cscu_escape (pbcmd, zlocalname)
usysdep_start_catch ();
alarm (1);
}
-
+
c = 0;
while (TRUE)
@@ -426,7 +426,7 @@ cscu_escape (pbcmd, zlocalname)
b = ']';
write (1, &b, 1);
}
-
+
if (c <= 0)
c = read (0, pbcmd, 1);
if (c >= 0 || errno != EINTR)
@@ -437,7 +437,7 @@ cscu_escape (pbcmd, zlocalname)
return c;
}
}
-}
+}
/* A SIGALRM handler which does nothing but send a signal to the child
process and schedule another alarm. POSIX.1 permits kill and alarm
@@ -715,7 +715,7 @@ uscu_child (qconn, opipe)
cwrite -= c;
zbuf += c;
}
- }
+ }
else
{
/* On some systems apparently read will return 0 until
@@ -788,7 +788,7 @@ fsysdep_terminal_raw (flocalecho)
}
fSterm = TRUE;
-
+
sSterm_new = sSterm_orig;
#if HAVE_BSD_TTY
@@ -1114,7 +1114,14 @@ fsysdep_shell (qconn, zcmd, tcmd)
int aidescs[3];
pid_t ipid;
- azargs[0] = "/bin/sh";
+ if (tcmd != SHELL_NORMAL)
+ azargs[0] = "/bin/sh";
+ else
+ {
+ azargs[0] = getenv ("SHELL");
+ if (azargs[0] == NULL)
+ azargs[0] = "/bin/sh";
+ }
if (zcmd == NULL || *zcmd == '\0')
azargs[1] = NULL;
else
@@ -1158,7 +1165,7 @@ fsysdep_shell (qconn, zcmd, tcmd)
aidescs[0] = oread;
if (tcmd == SHELL_STDOUT_TO_PORT || tcmd == SHELL_STDIO_ON_PORT)
aidescs[1] = owrite;
-
+
ipid = ixsspawn (azargs, aidescs, FALSE, TRUE, (const char *) NULL,
FALSE, FALSE, (const char *) NULL,
(const char *) NULL, (const char *) NULL);
OpenPOWER on IntegriCloud