pkgsrc/net/uucp/patches/patch-ad
jlam c1009ac844 Merge improvements from the version of Taylor UUCP 1.06.1 that exists
in NetBSD's src/gnu/libexec/uucp directory.  Changes include:

   * Teaching cu(1) about hardware flow control.
   * Make cu(1) honor "echocheck" and "binary mode" with respect to
     inspecting the data stream for newlines.
   * Make some proper integer casts so as not to break on LP64 platforms.
   * Teach uucp to substitute for \H with the IP address of the system.
   * Avoid potential divide-by-zero errors when computing times using
     serial rates.
   * Properly initialize some variables.

The main difference between this version and the one in NetBSD is the
location of uucico, uuconv, and uuxqt -- the vanilla UUCP location is
${PREFIX}/sbin while the NetBSD location is /usr/libexec/uucp.

Bump PKGREVISION to 1.
2006-10-30 03:33:59 +00:00

150 lines
4.4 KiB
Text

$NetBSD: patch-ad,v 1.1 2006/10/30 03:33:59 jlam Exp $
--- cu.c.orig 2003-05-29 02:08:45.000000000 -0400
+++ cu.c
@@ -258,6 +258,8 @@ main (argc, argv)
enum txonxoffsetting txonxoff = XONXOFF_ON;
/* -I: configuration file name. */
const char *zconfig = NULL;
+ /* -F/-f: Hard/Soft flow control. */
+ boolean hflow = TRUE;
int iopt;
pointer puuconf;
int iuuconf;
@@ -295,7 +297,7 @@ main (argc, argv)
}
}
- while ((iopt = getopt_long (argc, argv, "a:c:deE:hnI:l:op:s:tvx:z:",
+ while ((iopt = getopt_long (argc, argv, "a:c:deE:fFhnI:l:op:qs:tvx:z:",
asCulongopts, (int *) NULL)) != EOF)
{
switch (iopt)
@@ -322,6 +324,16 @@ main (argc, argv)
zCuvar_escape = optarg;
break;
+ case 'f':
+ /* No h/w flow control. */
+ hflow = FALSE;
+ break;
+
+ case 'F':
+ /* Use h/w flow control. */
+ hflow = TRUE;
+ break;
+
case 'h':
/* Local echo. */
fCulocalecho = TRUE;
@@ -348,6 +360,11 @@ main (argc, argv)
zport = optarg;
break;
+ case 'q':
+ /* Quiet file transfers */
+ fCuvar_verbose = FALSE;
+ break;
+
case 's':
/* Speed. */
ibaud = strtol (optarg, (char **) NULL, 10);
@@ -599,6 +616,8 @@ main (argc, argv)
sport.uuconf_palloc = NULL;
sport.uuconf_u.uuconf_sdirect.uuconf_zdevice = NULL;
sport.uuconf_u.uuconf_sdirect.uuconf_ibaud = ibaud;
+ sport.uuconf_u.uuconf_sdirect.uuconf_fcarrier = FALSE;
+ sport.uuconf_u.uuconf_sdirect.uuconf_fhardflow = hflow;
if (! fconn_init (&sport, &sconn, UUCONF_PORTTYPE_UNKNOWN))
ucuabort ();
@@ -842,11 +861,14 @@ ucuhelp ()
printf (" -e: Set even parity\n");
printf (" -o: Set odd parity\n");
printf (" --parity={odd,even}: Set parity\n");
+ printf (" -f: Use hardware flow control\n");
+ printf (" -F: Turn off hardware flow control (default)\n");
printf (" -E,--escape char: Set escape character\n");
printf (" -h,--halfduplex: Echo locally\n");
printf (" --nostop: Turn off XON/XOFF handling\n");
printf (" -t,--mapcr: Map carriage return to carriage return/linefeed\n");
printf (" -n,--prompt: Prompt for phone number\n");
+ printf (" -q: Be quiet during file transfers\n");
printf (" -d: Set maximum debugging level\n");
printf (" -x,--debug debug: Set debugging type\n");
#if HAVE_TAYLOR_CONFIG
@@ -1013,7 +1035,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
switch (bcmd)
{
default:
- if (! isprint (*zCuvar_escape))
+ if (! isprint (BUCHAR (*zCuvar_escape)))
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
@@ -1111,7 +1133,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
return TRUE;
case '?':
- if (! isprint (*zCuvar_escape))
+ if (! isprint (BUCHAR (*zCuvar_escape)))
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
@@ -1248,7 +1270,7 @@ icuunrecogvar (puuconf, argc, argv, pvar
{
char abescape[5];
- if (! isprint (*zCuvar_escape))
+ if (! isprint (BUCHAR (*zCuvar_escape)))
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
@@ -1302,7 +1324,7 @@ uculist_vars ()
{
int cchar;
- if (! isprint (*z))
+ if (! isprint (BUCHAR (*z)))
{
sprintf (abchar, "\\%03o", BUCHAR (*z));
cchar = 4;
@@ -1415,7 +1437,7 @@ icuunrecogfn (puuconf, argc, argv, pvar,
{
char abescape[5];
- if (! isprint (*zCuvar_escape))
+ if (! isprint (BUCHAR (*zCuvar_escape)))
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
@@ -2049,7 +2071,7 @@ fcusend_buf (qconn, zbufarg, cbufarg)
fnl = FALSE;
for (i = 0, zget = zbuf; i < csend; i++, zget++)
{
- if (isprint (*zget)
+ if (isprint (BUCHAR (*zget))
|| *zget == '\t')
*zput++ = *zget;
else if (*zget == '\n')
@@ -2082,8 +2104,10 @@ fcusend_buf (qconn, zbufarg, cbufarg)
mode. Echo checking of a newline is different from checking
of normal characters; when we send a newline we look for
*zCuvar_echonl. */
+ /* Don't check for newlines unless "echocheck" is on or "binary mode"
+ is off. From NetBSD PR bin/6834 by Frederick Bruckman. */
if ((fCuvar_echocheck && ! fCuvar_binary)
- || (fnl && *zCuvar_echonl != '\0'))
+ && (fnl && *zCuvar_echonl != '\0'))
{
long iend;
@@ -2101,7 +2125,7 @@ fcusend_buf (qconn, zbufarg, cbufarg)
}
else
{
- if (! fCuvar_echocheck || ! isprint (*zget))
+ if (! fCuvar_echocheck || ! isprint (BUCHAR (*zget)))
continue;
bwant = *zget;
}