home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 51
/
Amiga_Dream_51.iso
/
Atari
/
Desktops
/
text113b.zoo
/
textutils-1.13
/
src
/
diffs
< prev
next >
Wrap
Text File
|
1996-01-23
|
13KB
|
536 lines
diff -u ./cat.c /d/textutils-1.13.new/src/cat.c
--- ./cat.c Tue Sep 19 14:59:08 1995
+++ /d/textutils-1.13.new/src/cat.c Sat Jan 20 18:18:48 1996
@@ -30,6 +30,9 @@
#ifndef _POSIX_SOURCE
#include <sys/ioctl.h>
#endif
+#ifdef atarist
+# undef FIONREAD
+#endif
#include "system.h"
#include "version.h"
#include "error.h"
diff -u ./cksum.c /d/textutils-1.13.new/src/cksum.c
--- ./cksum.c Sun Sep 24 15:28:10 1995
+++ /d/textutils-1.13.new/src/cksum.c Fri Jan 19 02:56:44 1996
@@ -114,6 +114,10 @@
/* Number of bytes to read at once. */
#define BUFLEN (1 << 16)
+#ifdef atarist
+long _stksize = BUFLEN + 8192;
+#endif
+
/* The name this program was run with. */
char *program_name;
@@ -217,6 +221,9 @@
return -1;
}
}
+#ifdef atarist
+ fp->_flag |= _IOBIN;
+#endif
while ((bytes_read = fread (buf, 1, BUFLEN, fp)) > 0)
{
diff -u ./comm.c /d/textutils-1.13.new/src/comm.c
--- ./comm.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/comm.c Fri Jan 19 03:00:26 1996
@@ -155,6 +155,9 @@
error (0, errno, "%s", infiles[i]);
return 1;
}
+#ifdef atarist
+ streams[i]->_flag &= ~_IOBIN;
+#endif
thisline[i] = readline (thisline[i], streams[i]);
}
diff -u ./csplit.c /d/textutils-1.13.new/src/csplit.c
--- ./csplit.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/csplit.c Sat Jan 20 19:08:04 1996
@@ -1000,7 +1000,11 @@
create_output_file ()
{
output_filename = make_filename (files_created);
+#ifdef atarist
+ output_stream = fopen (output_filename, "wb");
+#else
output_stream = fopen (output_filename, "w");
+#endif
if (output_stream == NULL)
{
error (0, errno, "%s", output_filename);
diff -u ./cut.c /d/textutils-1.13.new/src/cut.c
--- ./cut.c Sun Sep 24 15:30:48 1995
+++ /d/textutils-1.13.new/src/cut.c Fri Jan 19 03:01:46 1996
@@ -653,6 +653,9 @@
return 1;
}
}
+#ifdef atarist
+ stream->_flag &= ~_IOBIN;
+#endif
cut_stream (stream);
diff -u ./expand.c /d/textutils-1.13.new/src/expand.c
--- ./expand.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/expand.c Fri Jan 19 02:50:06 1996
@@ -370,9 +370,16 @@
{
have_read_stdin = 1;
prev_file = file;
+#ifdef atarist
+ stdin->_flag &= ~_IOBIN;
+#endif
return stdin;
}
+#ifdef atarist
+ fp = fopen (file, "rt");
+#else
fp = fopen (file, "r");
+#endif
if (fp)
{
prev_file = file;
diff -u ./fmt.c /d/textutils-1.13.new/src/fmt.c
--- ./fmt.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/fmt.c Fri Jan 19 02:50:08 1996
@@ -395,6 +395,9 @@
best_width = max_width * (2 * (100 - LEEWAY) + 1) / 200;
+#ifdef atarist
+ stdin->_flag &= ~_IOBIN;
+#endif
if (optind == argc)
fmt (stdin);
else
@@ -403,7 +406,11 @@
fmt (stdin);
else
{
+#ifdef atarist
+ infile = fopen (argv[optind], "rt");
+#else
infile = fopen (argv[optind], "r");
+#endif
if (infile != NULL)
{
fmt (infile);
diff -u ./fold.c /d/textutils-1.13.new/src/fold.c
--- ./fold.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/fold.c Fri Jan 19 03:04:24 1996
@@ -195,6 +195,9 @@
error (0, errno, "%s", filename);
return 1;
}
+#ifdef atarist
+ istream->_flag &= ~_IOBIN;
+#endif
while ((c = getc (istream)) != EOF)
{
diff -u ./head.c /d/textutils-1.13.new/src/head.c
--- ./head.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/head.c Sat Jan 20 19:17:20 1996
@@ -38,7 +38,9 @@
/* Size of atomic reads. */
#define BUFSIZE (512 * 8)
-
+#ifdef atarist
+long _stksize = BUFSIZE + 8 * 1024;
+#endif
/* Number of bytes per item we are printing.
If 0, head in lines. */
static int unit_size;
@@ -97,6 +99,9 @@
long number = -1; /* Number of items to print (-1 if undef.). */
int c; /* Option character. */
+#ifdef atarist
+ stdout->_flag |= _IOBIN;
+#endif
program_name = argv[0];
have_read_stdin = 0;
unit_size = 0;
diff -u ./join.c /d/textutils-1.13.new/src/join.c
--- ./join.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/join.c Fri Jan 19 03:08:44 1996
@@ -723,6 +723,10 @@
error (1, errno, "%s", names[1]);
if (fp1 == fp2)
error (1, errno, _("both files cannot be standard input"));
+#ifdef atarist
+ fp1->_flag &= ~_IOBIN;
+ fp2->_flag &= ~_IOBIN;
+#endif
join (fp1, fp2);
if ((fp1 == stdin || fp2 == stdin) && fclose (stdin) == EOF)
diff -u ./md5sum.c /d/textutils-1.13.new/src/md5sum.c
--- ./md5sum.c Wed Sep 20 15:13:30 1995
+++ /d/textutils-1.13.new/src/md5sum.c Sat Jan 20 18:46:52 1996
@@ -38,6 +38,10 @@
#if UNIX || __UNIX__ || unix || __unix__ || _POSIX_VERSION
# define OPENOPTS(BINARY) "r"
#else
+# ifdef atarist
+# define TEXT1TO1 "rb"
+# define TEXTCNVT "rt"
+# else
# ifdef MSDOS
# define TEXT1TO1 "rb"
# define TEXTCNVT "r"
@@ -51,6 +55,7 @@
"Cannot determine system type."
# endif
# endif
+# endif
# define OPENOPTS(BINARY) ((BINARY) != 0 ? TEXT1TO1 : TEXTCNVT)
#endif
@@ -85,6 +90,10 @@
{ NULL, 0, NULL, 0 }
};
+#ifdef atarist
+long _stksize = 16 * 1024;
+#endif
+
char *xmalloc ();
static void
@@ -247,7 +256,12 @@
}
else
{
+#ifdef atarist
+ /* Don't remove any character from the file name */
+ checkfile_stream = fopen (checkfile_name, "rb");
+#else
checkfile_stream = fopen (checkfile_name, "r");
+#endif
if (checkfile_stream == NULL)
{
error (0, errno, "%s", checkfile_name);
@@ -409,6 +423,12 @@
/* Text is default of the Plumb/Lankester format. */
int binary = 0;
+#ifdef atarist
+ /* Don't generate CR after file name for DOS line ending, because it
+ * would be taken as part of the file name when using -c.
+ */
+ stdout->_flag |= _IOBIN;
+#endif
/* Setting values of global variables. */
program_name = argv[0];
diff -u ./nl.c /d/textutils-1.13.new/src/nl.c
--- ./nl.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/nl.c Fri Jan 19 03:11:28 1996
@@ -344,6 +344,9 @@
return 1;
}
}
+#ifdef atarist
+ stream->_flag &= ~_IOBIN;
+#endif
process_file (stream);
diff -u ./od.c /d/textutils-1.13.new/src/od.c
--- ./od.c Wed Sep 27 17:57:08 1995
+++ /d/textutils-1.13.new/src/od.c Fri Jan 19 03:16:28 1996
@@ -976,6 +976,9 @@
continue;
}
}
+#ifdef atarist
+ in_stream->_flag |= _IOBIN;
+#endif
if (n_skip == 0)
break;
@@ -1224,6 +1227,9 @@
err = 1;
}
}
+#ifdef atarist
+ in_stream->_flag |= _IOBIN;
+#endif
}
while (in_stream == NULL);
}
@@ -1299,6 +1305,9 @@
err = 1;
}
}
+#ifdef atarist
+ in_stream->_flag |= _IOBIN;
+#endif
}
while (in_stream == NULL);
}
diff -u ./paste.c /d/textutils-1.13.new/src/paste.c
--- ./paste.c Mon Aug 7 06:52:38 1995
+++ /d/textutils-1.13.new/src/paste.c Fri Jan 19 03:19:02 1996
@@ -283,6 +283,9 @@
else if (fileno (fileptr[files_open]) == 0)
opened_stdin = 1;
}
+#ifdef atarist
+ fileptr[files_open]->_flag &= ~_IOBIN;
+#endif
}
fileptr[files_open] = ENDLIST;
@@ -425,6 +428,9 @@
continue;
}
}
+#ifdef atarist
+ fileptr->_flag &= ~_IOBIN;
+#endif
delimptr = delims; /* Set up for delimiter string. */
diff -u ./pr.c /d/textutils-1.13.new/src/pr.c
--- ./pr.c Fri Aug 11 08:24:16 1995
+++ /d/textutils-1.13.new/src/pr.c Fri Jan 19 03:20:34 1996
@@ -945,6 +945,9 @@
error (0, errno, "%s", name);
return 0;
}
+#ifdef atarist
+ p->fp->_flag &= ~_IOBIN;
+#endif
p->status = OPEN;
++total_files;
return 1;
diff -u ./sort.c /d/textutils-1.13.new/src/sort.c
--- ./sort.c Thu Sep 14 15:58:44 1995
+++ /d/textutils-1.13.new/src/sort.c Fri Jan 19 02:50:30 1996
@@ -58,6 +58,10 @@
#define DEFAULT_TMPDIR "/tmp"
#endif
+#ifdef atarist
+long _stksize = 16 * 1024;
+#endif
+
/* The kind of blanks for '-b' to skip in various options. */
enum blanktype { bl_start, bl_end, bl_both };
@@ -1258,7 +1262,11 @@
for (i = 0; i < nfiles; ++i)
{
+#ifdef atarist
+ fp = xfopen (files[i], "rt");
+#else
fp = xfopen (files[i], "r");
+#endif
if (!checkfp (fp))
{
fprintf (stderr, _("%s: disorder on %s\n"), program_name, files[i]);
@@ -1286,7 +1294,11 @@
for (i = 0; i < nfiles / NMERGE; ++i)
{
for (j = 0; j < NMERGE; ++j)
+#ifdef atarist
+ fps[j] = xfopen (files[i * NMERGE + j], "rt");
+#else
fps[j] = xfopen (files[i * NMERGE + j], "r");
+#endif
tfp = xfopen (temp = tempname (), "w");
mergefps (fps, NMERGE, tfp);
xfclose (tfp);
@@ -1295,7 +1307,11 @@
files[t++] = temp;
}
for (j = 0; j < nfiles % NMERGE; ++j)
+#ifdef atarist
+ fps[j] = xfopen (files[i * NMERGE + j], "rt");
+#else
fps[j] = xfopen (files[i * NMERGE + j], "r");
+#endif
tfp = xfopen (temp = tempname (), "w");
mergefps (fps, nfiles % NMERGE, tfp);
xfclose (tfp);
@@ -1306,7 +1322,11 @@
}
for (i = 0; i < nfiles; ++i)
+#ifdef atarist
+ fps[i] = xfopen (files[i], "rt");
+#else
fps[i] = xfopen (files[i], "r");
+#endif
mergefps (fps, i, ofp);
for (i = 0; i < nfiles; ++i)
zaptemp (files[i]);
@@ -1337,7 +1357,11 @@
while (nfiles--)
{
+#ifdef atarist
+ fp = xfopen (*files++, "rt");
+#else
fp = xfopen (*files++, "r");
+#endif
while (fillbuf (&buf, fp))
{
findlines (&buf, &lines);
@@ -1501,6 +1525,9 @@
parse_long_options (argc, argv, "sort", version_string, usage);
have_read_stdin = 0;
+#ifdef atarist
+ stdin->_flag &= ~_IOBIN;
+#endif
inittables ();
temp_file_prefix = getenv ("TMPDIR");
@@ -1816,7 +1843,11 @@
}
}
+#ifdef atarist
+ fp = xfopen (files[i], "rt");
+#else
fp = xfopen (files[i], "r");
+#endif
tmp = tempname ();
ofp = xfopen (tmp, "w");
while ((cc = fread (buf, 1, sizeof buf, fp)) > 0)
diff -u ./sum.c /d/textutils-1.13.new/src/sum.c
--- ./sum.c Mon Aug 7 06:52:40 1995
+++ /d/textutils-1.13.new/src/sum.c Fri Jan 19 03:23:18 1996
@@ -31,6 +31,10 @@
static int bsd_sum_file ();
static int sysv_sum_file ();
+#ifdef atarist
+long _stksize = 16 * 1024;
+#endif
+
int safe_read ();
/* The name this program was run with. */
@@ -171,6 +175,9 @@
return -1;
}
}
+#ifdef atarist
+ fp->_flag |= _IOBIN;
+#endif
/* This algorithm seems to depend on sign extension in `ch' in order to
give the right results. Ick. */
diff -u ./tac.c /d/textutils-1.13.new/src/tac.c
--- ./tac.c Mon Aug 7 06:52:40 1995
+++ /d/textutils-1.13.new/src/tac.c Fri Jan 19 02:50:34 1996
@@ -60,7 +60,9 @@
/* The number of bytes per atomic write. */
#define WRITESIZE 8192
-
+#ifdef atarist
+long _stksize = WRITESIZE + 8 * 1024;
+#endif
char *mktemp ();
static RETSIGTYPE cleanup ();
diff -u ./tail.c /d/textutils-1.13.new/src/tail.c
--- ./tail.c Mon Aug 7 06:52:40 1995
+++ /d/textutils-1.13.new/src/tail.c Sat Jan 20 19:20:42 1996
@@ -76,6 +76,10 @@
#define BUFSIZ (512 * 8)
#endif
+#ifdef atarist
+long _stksize = BUFSIZ + 8 * 1024;
+#endif
+
/* If nonzero, interpret the numeric argument as the number of lines.
Otherwise, interpret it as the number of bytes. */
static int count_lines;
@@ -161,6 +165,9 @@
int c; /* Option character. */
int fileind; /* Index in ARGV of first file name. */
+#ifdef atarist
+ stdout->_flag |= _IOBIN;
+#endif
program_name = argv[0];
have_read_stdin = 0;
count_lines = 1;
diff -u ./tr.c /d/textutils-1.13.new/src/tr.c
--- ./tr.c Mon Aug 7 06:52:40 1995
+++ /d/textutils-1.13.new/src/tr.c Sat Jan 20 19:00:20 1996
@@ -1685,6 +1685,9 @@
struct Spec_list *s1 = &buf1;
struct Spec_list *s2 = &buf2;
+#ifdef atarist
+ stdout->_flag |= _IOBIN;
+#endif
program_name = argv[0];
while ((c = getopt_long (argc, argv, "cdst", long_options,
diff -u ./unexpand.c /d/textutils-1.13.new/src/unexpand.c
--- ./unexpand.c Mon Aug 7 06:52:40 1995
+++ /d/textutils-1.13.new/src/unexpand.c Fri Jan 19 02:50:38 1996
@@ -425,9 +425,16 @@
{
have_read_stdin = 1;
prev_file = file;
+#ifdef atarist
+ stdin->_flag &= ~_IOBIN;
+#endif
return stdin;
}
+#ifdef atarist
+ fp = fopen (file, "rt");
+#else
fp = fopen (file, "r");
+#endif
if (fp)
{
prev_file = file;
diff -u ./uniq.c /d/textutils-1.13.new/src/uniq.c
--- ./uniq.c Mon Aug 7 06:52:40 1995
+++ /d/textutils-1.13.new/src/uniq.c Fri Jan 19 03:31:14 1996
@@ -206,8 +206,12 @@
istream = stdin;
else
istream = fopen (infile, "r");
+
if (istream == NULL)
error (1, errno, "%s", infile);
+#ifdef atarist
+ istream->_flag &= ~_IOBIN;
+#endif
if (!strcmp (outfile, "-"))
ostream = stdout;
diff -u ./wc.c /d/textutils-1.13.new/src/wc.c
--- ./wc.c Mon Aug 7 06:52:40 1995
+++ /d/textutils-1.13.new/src/wc.c Fri Jan 19 02:50:40 1996
@@ -29,6 +29,9 @@
/* Size of atomic reads. */
#define BUFFER_SIZE (16 * 1024)
+#ifdef atarist
+long _stksize = BUFFER_SIZE + 8 * 1024;
+#endif
int safe_read ();