<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=Uudecode</id>
		<title>Uudecode - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=Uudecode"/>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=Uudecode&amp;action=history"/>
		<updated>2026-05-16T18:08:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.1</generator>

	<entry>
		<id>https://gunkies.org/w/index.php?title=Uudecode&amp;diff=19955&amp;oldid=prev</id>
		<title>Jnc: +cat</title>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=Uudecode&amp;diff=19955&amp;oldid=prev"/>
				<updated>2018-12-16T23:33:17Z</updated>
		
		<summary type="html">&lt;p&gt;+cat&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:33, 16 December 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l234&quot; &gt;Line 234:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 234:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:UNIX Applications]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki-wiki_:diff:version:1.11a:oldid:10460:newid:19955 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jnc</name></author>	</entry>

	<entry>
		<id>https://gunkies.org/w/index.php?title=Uudecode&amp;diff=10460&amp;oldid=prev</id>
		<title>Neozeed: I'm tired of looking for this thing, and it's damned handy to have!!!!!</title>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=Uudecode&amp;diff=10460&amp;oldid=prev"/>
				<updated>2011-05-05T13:44:36Z</updated>
		
		<summary type="html">&lt;p&gt;I&amp;#039;m tired of looking for this thing, and it&amp;#039;s damned handy to have!!!!!&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;UUdecode decodes a [[uuencoded]] text file into a binary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== source ==&lt;br /&gt;
This should compile on all kinds of things...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 1983 Regents of the University of California.&lt;br /&gt;
 * All rights reserved.&lt;br /&gt;
 *&lt;br /&gt;
 * Redistribution and use in source and binary forms are permitted&lt;br /&gt;
 * provided that the above copyright notice and this paragraph are&lt;br /&gt;
 * duplicated in all such forms and that any documentation,&lt;br /&gt;
 * advertising materials, and other materials related to such&lt;br /&gt;
 * distribution and use acknowledge that the software was developed&lt;br /&gt;
 * by the University of California, Berkeley.  The name of the&lt;br /&gt;
 * University may not be used to endorse or promote products derived&lt;br /&gt;
 * from this software without specific prior written permission.&lt;br /&gt;
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR&lt;br /&gt;
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED&lt;br /&gt;
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Modified 12 April 1990 by Mark Adler for use on MSDOS systems with&lt;br /&gt;
 * Microsoft C and Turbo C.&lt;br /&gt;
 *&lt;br /&gt;
 * Modifed 13 February 1991 by Greg Roelofs for use on VMS systems.  As&lt;br /&gt;
 * with the MS-DOS version, the setting of the file mode has been disabled.&lt;br /&gt;
 * Compile and link normally (but note that the shared-image link option&lt;br /&gt;
 * produces a binary only 6 blocks long, as opposed to the 137-block one&lt;br /&gt;
 * produced by an ordinary link).  To set up the VMS symbol to run the&lt;br /&gt;
 * program (&amp;quot;run uudecode filename&amp;quot; won't work), do:&lt;br /&gt;
 *		uudecode :== &amp;quot;$disk:[directory]uudecode.exe&amp;quot;&lt;br /&gt;
 * and don't forget the leading &amp;quot;$&amp;quot; or it still won't work.  The binaries&lt;br /&gt;
 * produced by this program are in VMS &amp;quot;stream-LF&amp;quot; format; this makes no&lt;br /&gt;
 * difference to VMS when running decoded executables, nor to VMS unzip,&lt;br /&gt;
 * but other programs such as zoo or arc may or may not require the file&lt;br /&gt;
 * to be &amp;quot;BILFed&amp;quot; (or &amp;quot;unBILFed&amp;quot; or whatever).  Also, unlike the other&lt;br /&gt;
 * flavors, VMS files don't get overwritten (a higher version is created).&lt;br /&gt;
 * &lt;br /&gt;
 * Modified 13 April 1991 by Gary Mussar to be forgiving of systems that&lt;br /&gt;
 * appear to be stripping trailing blanks.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef lint&lt;br /&gt;
static char sccsid[] = &amp;quot;@(#)uudecode.c	5.5 (Berkeley) 7/6/88&amp;quot;;&lt;br /&gt;
#endif /* not lint */&lt;br /&gt;
&lt;br /&gt;
#ifdef __MSDOS__        /* For Turbo C */&lt;br /&gt;
#define MSDOS 1&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * uudecode [input]&lt;br /&gt;
 *&lt;br /&gt;
 * create the specified file, decoding as you go.&lt;br /&gt;
 * used with uuencode.&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#ifdef VMS&lt;br /&gt;
#  include &amp;lt;types.h&amp;gt;&lt;br /&gt;
#  include &amp;lt;stat.h&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#  ifndef MSDOS            /* i.e., UNIX */&lt;br /&gt;
#    include &amp;lt;pwd.h&amp;gt;&lt;br /&gt;
#  endif&lt;br /&gt;
#  include &amp;lt;sys/types.h&amp;gt;   /* MSDOS or UNIX */&lt;br /&gt;
#  include &amp;lt;sys/stat.h&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
/* single-character decode */&lt;br /&gt;
#define DEC(c)	(((c) - ' ') &amp;amp; 077)&lt;br /&gt;
&lt;br /&gt;
main(argc, argv)&lt;br /&gt;
char **argv;&lt;br /&gt;
{&lt;br /&gt;
	FILE *in, *out;&lt;br /&gt;
	int mode;&lt;br /&gt;
	char dest[128];&lt;br /&gt;
	char buf[80];&lt;br /&gt;
&lt;br /&gt;
	/* optional input arg */&lt;br /&gt;
	if (argc &amp;gt; 1) {&lt;br /&gt;
		if ((in = fopen(argv[1], &amp;quot;r&amp;quot;)) == NULL) {&lt;br /&gt;
			perror(argv[1]);&lt;br /&gt;
			exit(1);&lt;br /&gt;
		}&lt;br /&gt;
		argv++; argc--;&lt;br /&gt;
	} else&lt;br /&gt;
		in = stdin;&lt;br /&gt;
&lt;br /&gt;
	if (argc != 1) {&lt;br /&gt;
		printf(&amp;quot;Usage: uudecode [infile]\n&amp;quot;);&lt;br /&gt;
		exit(2);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/* search for header line */&lt;br /&gt;
	for (;;) {&lt;br /&gt;
		if (fgets(buf, sizeof buf, in) == NULL) {&lt;br /&gt;
			fprintf(stderr, &amp;quot;No begin line\n&amp;quot;);&lt;br /&gt;
			exit(3);&lt;br /&gt;
		}&lt;br /&gt;
		if (strncmp(buf, &amp;quot;begin &amp;quot;, 6) == 0)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
	(void)sscanf(buf, &amp;quot;begin %o %s&amp;quot;, &amp;amp;mode, dest);&lt;br /&gt;
&lt;br /&gt;
#if !defined(MSDOS) &amp;amp;&amp;amp; !defined(VMS)	/* i.e., UNIX */&lt;br /&gt;
	/* handle ~user/file format */&lt;br /&gt;
	if (dest[0] == '~') {&lt;br /&gt;
		char *sl;&lt;br /&gt;
		struct passwd *getpwnam();&lt;br /&gt;
		struct passwd *user;&lt;br /&gt;
		char dnbuf[100], *index(), *strcat(), *strcpy();&lt;br /&gt;
&lt;br /&gt;
		sl = index(dest, '/');&lt;br /&gt;
		if (sl == NULL) {&lt;br /&gt;
			fprintf(stderr, &amp;quot;Illegal ~user\n&amp;quot;);&lt;br /&gt;
			exit(3);&lt;br /&gt;
		}&lt;br /&gt;
		*sl++ = 0;&lt;br /&gt;
		user = getpwnam(dest+1);&lt;br /&gt;
		if (user == NULL) {&lt;br /&gt;
			fprintf(stderr, &amp;quot;No such user as %s\n&amp;quot;, dest);&lt;br /&gt;
			exit(4);&lt;br /&gt;
		}&lt;br /&gt;
		strcpy(dnbuf, user-&amp;gt;pw_dir);&lt;br /&gt;
		strcat(dnbuf, &amp;quot;/&amp;quot;);&lt;br /&gt;
		strcat(dnbuf, sl);&lt;br /&gt;
		strcpy(dest, dnbuf);&lt;br /&gt;
	}&lt;br /&gt;
#endif	/* !defined(MSDOS) &amp;amp;&amp;amp; !defined(VMS) */&lt;br /&gt;
&lt;br /&gt;
	/* create output file */&lt;br /&gt;
#ifdef MSDOS&lt;br /&gt;
	out = fopen(dest, &amp;quot;wb&amp;quot;);	/* Binary file */&lt;br /&gt;
#else&lt;br /&gt;
	out = fopen(dest, &amp;quot;w&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
	if (out == NULL) {&lt;br /&gt;
		perror(dest);&lt;br /&gt;
		exit(4);&lt;br /&gt;
	}&lt;br /&gt;
#if !defined(MSDOS) &amp;amp;&amp;amp; !defined(VMS)	/* i.e., UNIX */&lt;br /&gt;
	chmod(dest, mode);&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
	decode(in, out);&lt;br /&gt;
&lt;br /&gt;
	if (fgets(buf, sizeof buf, in) == NULL || strcmp(buf, &amp;quot;end\n&amp;quot;)) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;No end line\n&amp;quot;);&lt;br /&gt;
		exit(5);&lt;br /&gt;
	}&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * copy from in to out, decoding as you go along.&lt;br /&gt;
 */&lt;br /&gt;
decode(in, out)&lt;br /&gt;
FILE *in;&lt;br /&gt;
FILE *out;&lt;br /&gt;
{&lt;br /&gt;
	char buf[80];&lt;br /&gt;
	char *bp;&lt;br /&gt;
	int n, i, expected;&lt;br /&gt;
&lt;br /&gt;
	for (;;) {&lt;br /&gt;
		/* for each input line */&lt;br /&gt;
		if (fgets(buf, sizeof buf, in) == NULL) {&lt;br /&gt;
			printf(&amp;quot;Short file\n&amp;quot;);&lt;br /&gt;
			exit(10);&lt;br /&gt;
		}&lt;br /&gt;
		n = DEC(buf[0]);&lt;br /&gt;
		if ((n &amp;lt;= 0) || (buf[0] == '\n'))&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
		/* Calculate expected # of chars and pad if necessary */&lt;br /&gt;
		expected = ((n+2)/3)&amp;lt;&amp;lt;2;&lt;br /&gt;
		for (i = strlen(buf)-1; i &amp;lt;= expected; i++) buf[i] = ' ';&lt;br /&gt;
&lt;br /&gt;
		bp = &amp;amp;buf[1];&lt;br /&gt;
		while (n &amp;gt; 0) {&lt;br /&gt;
			outdec(bp, out, n);&lt;br /&gt;
			bp += 4;&lt;br /&gt;
			n -= 3;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * output a group of 3 bytes (4 input characters).&lt;br /&gt;
 * the input chars are pointed to by p, they are to&lt;br /&gt;
 * be output to file f.  n is used to tell us not to&lt;br /&gt;
 * output all of them at the end of the file.&lt;br /&gt;
 */&lt;br /&gt;
outdec(p, f, n)&lt;br /&gt;
char *p;&lt;br /&gt;
FILE *f;&lt;br /&gt;
{&lt;br /&gt;
	int c1, c2, c3;&lt;br /&gt;
&lt;br /&gt;
	c1 = DEC(*p) &amp;lt;&amp;lt; 2 | DEC(p[1]) &amp;gt;&amp;gt; 4;&lt;br /&gt;
	c2 = DEC(p[1]) &amp;lt;&amp;lt; 4 | DEC(p[2]) &amp;gt;&amp;gt; 2;&lt;br /&gt;
	c3 = DEC(p[2]) &amp;lt;&amp;lt; 6 | DEC(p[3]);&lt;br /&gt;
	if (n &amp;gt;= 1)&lt;br /&gt;
		putc(c1, f);&lt;br /&gt;
	if (n &amp;gt;= 2)&lt;br /&gt;
		putc(c2, f);&lt;br /&gt;
	if (n &amp;gt;= 3)&lt;br /&gt;
		putc(c3, f);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Return the ptr in sp at which the character c appears;&lt;br /&gt;
 * NULL if not found&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#define	NULL	0&lt;br /&gt;
&lt;br /&gt;
char *&lt;br /&gt;
index(sp, c)&lt;br /&gt;
register char *sp, c;&lt;br /&gt;
{&lt;br /&gt;
	do {&lt;br /&gt;
		if (*sp == c)&lt;br /&gt;
			return(sp);&lt;br /&gt;
	} while (*sp++);&lt;br /&gt;
	return(NULL);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Neozeed</name></author>	</entry>

	</feed>