[Midnightbsd-cvs] src [10891] sync with freebsd

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jun 13 20:13:28 EDT 2018


Revision: 10891
          http://svnweb.midnightbsd.org/src/?rev=10891
Author:   laffer1
Date:     2018-06-13 20:13:27 -0400 (Wed, 13 Jun 2018)
Log Message:
-----------
sync with freebsd

Modified Paths:
--------------
    trunk/usr.bin/uuencode/uuencode.1
    trunk/usr.bin/uuencode/uuencode.c

Property Changed:
----------------
    trunk/usr.bin/uuencode/uuencode.1

Modified: trunk/usr.bin/uuencode/uuencode.1
===================================================================
--- trunk/usr.bin/uuencode/uuencode.1	2018-06-14 00:06:48 UTC (rev 10890)
+++ trunk/usr.bin/uuencode/uuencode.1	2018-06-14 00:13:27 UTC (rev 10891)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -26,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)uuencode.1	8.1 (Berkeley) 6/6/93
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/uuencode/uuencode.1 297960 2016-04-14 11:45:52Z gahr $
 .\"
 .Dd January 27, 2002
 .Dt UUENCODE 1
@@ -40,6 +41,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl m
+.Op Fl r 
 .Op Fl o Ar output_file
 .Op Ar file
 .Ar name
@@ -50,6 +52,7 @@
 .Op Fl i
 .Fl o Ar output_file
 .Nm b64encode
+.Op Fl r
 .Op Fl o Ar output_file
 .Op Ar file
 .Ar name
@@ -123,6 +126,8 @@
 Use the Base64 method of encoding, rather than the traditional
 .Nm
 algorithm.
+.It Fl r
+Produce raw output by excluding the initial and final framing lines.
 .It Fl o Ar output_file
 Output to
 .Ar output_file


Property changes on: trunk/usr.bin/uuencode/uuencode.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/uuencode/uuencode.c
===================================================================
--- trunk/usr.bin/uuencode/uuencode.c	2018-06-14 00:06:48 UTC (rev 10890)
+++ trunk/usr.bin/uuencode/uuencode.c	2018-06-14 00:13:27 UTC (rev 10891)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1983, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -39,7 +40,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/uuencode/uuencode.c 297960 2016-04-14 11:45:52Z gahr $");
 
 /*
  * uuencode [input] output
@@ -60,13 +61,14 @@
 #include <string.h>
 #include <unistd.h>
 
-void encode(void);
-void base64_encode(void);
+static void encode(void);
+static void base64_encode(void);
 static void usage(void);
 
-FILE *output;
-int mode;
-char **av;
+static FILE *output;
+static int mode;
+static char raw = 0;
+static char **av;
 
 int
 main(int argc, char *argv[])
@@ -82,7 +84,7 @@
 	if (strcmp(basename(argv[0]), "b64encode") == 0)
 		base64 = 1;
 
-	while ((ch = getopt(argc, argv, "mo:")) != -1) {
+	while ((ch = getopt(argc, argv, "mo:r")) != -1) {
 		switch (ch) {
 		case 'm':
 			base64 = 1;
@@ -90,6 +92,9 @@
 		case 'o':
 			outfile = optarg;
 			break;
+		case 'r':
+			raw = 1;
+			break;
 		case '?':
 		default:
 			usage();
@@ -138,7 +143,7 @@
 /*
  * Copy from in to out, encoding in base64 as you go along.
  */
-void
+static void
 base64_encode(void)
 {
 	/*
@@ -152,7 +157,8 @@
 
 	sequence = 0;
 
-	fprintf(output, "begin-base64 %o %s\n", mode, *av);
+	if (!raw)
+		fprintf(output, "begin-base64 %o %s\n", mode, *av);
 	while ((n = fread(buf, 1, sizeof(buf), stdin))) {
 		++sequence;
 		rv = b64_ntop(buf, n, buf2, (sizeof(buf2) / sizeof(buf2[0])));
@@ -162,13 +168,14 @@
 	}
 	if (sequence % GROUPS)
 		fprintf(output, "\n");
-	fprintf(output, "====\n");
+	if (!raw)
+		fprintf(output, "====\n");
 }
 
 /*
  * Copy from in to out, encoding as you go along.
  */
-void
+static void
 encode(void)
 {
 	register int ch, n;
@@ -175,7 +182,8 @@
 	register char *p;
 	char buf[80];
 
-	(void)fprintf(output, "begin %o %s\n", mode, *av);
+	if (!raw)
+		(void)fprintf(output, "begin %o %s\n", mode, *av);
 	while ((n = fread(buf, 1, 45, stdin))) {
 		ch = ENC(n);
 		if (fputc(ch, output) == EOF)
@@ -209,7 +217,8 @@
 	}
 	if (ferror(stdin))
 		errx(1, "read error");
-	(void)fprintf(output, "%c\nend\n", ENC('\0'));
+	if (!raw)
+		(void)fprintf(output, "%c\nend\n", ENC('\0'));
 }
 
 static void



More information about the Midnightbsd-cvs mailing list