ast@cs.vu.nl (Andy Tanenbaum) (05/30/88)
: This is a shar archive. Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'abort.c.diff'
sed 's/^X//' > 'abort.c.diff' << '+ END-OF-FILE ''abort.c.diff'
X0a1,2
X> #include <signal.h>
X>
X3c5
X< exit(99);
X---
X> return(kill(getpid(), SIGIOT));
+ END-OF-FILE abort.c.diff
chmod 'u=rw,g=rw,o=rw' 'abort.c.diff'
set `wc -c 'abort.c.diff'`
count=$1
case $count in
89) :;;
*) echo 'Bad character count in ''abort.c.diff' >&2
echo 'Count should be 89' >&2
esac
echo Extracting 'access.c.diff'
sed 's/^X//' > 'access.c.diff' << '+ END-OF-FILE ''access.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE access.c.diff
chmod 'u=rw,g=rw,o=rw' 'access.c.diff'
set `wc -c 'access.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''access.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'alarm.c.diff'
sed 's/^X//' > 'alarm.c.diff' << '+ END-OF-FILE ''alarm.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE alarm.c.diff
chmod 'u=rw,g=rw,o=rw' 'alarm.c.diff'
set `wc -c 'alarm.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''alarm.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'atol.c.diff'
sed 's/^X//' > 'atol.c.diff' << '+ END-OF-FILE ''atol.c.diff'
X1c1
X< #include "../include/ctype.h"
X---
X> #include <ctype.h>
+ END-OF-FILE atol.c.diff
chmod 'u=rw,g=rw,o=rw' 'atol.c.diff'
set `wc -c 'atol.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''atol.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'brk.c.diff'
sed 's/^X//' > 'brk.c.diff' << '+ END-OF-FILE ''brk.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
X21c21
X< char *incr;
X---
X> int incr;
X27c27,28
X< newsize = brksize + (int) incr;
X---
X> newsize = brksize + incr;
X> if (incr > 0 && newsize < oldsize) return( (char *) -1);
+ END-OF-FILE brk.c.diff
chmod 'u=rw,g=rw,o=rw' 'brk.c.diff'
set `wc -c 'brk.c.diff'`
count=$1
case $count in
233) :;;
*) echo 'Bad character count in ''brk.c.diff' >&2
echo 'Count should be 233' >&2
esac
echo Extracting 'brk2.c.diff'
sed 's/^X//' > 'brk2.c.diff' << '+ END-OF-FILE ''brk2.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE brk2.c.diff
chmod 'u=rw,g=rw,o=rw' 'brk2.c.diff'
set `wc -c 'brk2.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''brk2.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'call.c.diff'
sed 's/^X//' > 'call.c.diff' << '+ END-OF-FILE ''call.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE call.c.diff
chmod 'u=rw,g=rw,o=rw' 'call.c.diff'
set `wc -c 'call.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''call.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'chdir.c.diff'
sed 's/^X//' > 'chdir.c.diff' << '+ END-OF-FILE ''chdir.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE chdir.c.diff
chmod 'u=rw,g=rw,o=rw' 'chdir.c.diff'
set `wc -c 'chdir.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''chdir.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'chmod.c.diff'
sed 's/^X//' > 'chmod.c.diff' << '+ END-OF-FILE ''chmod.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE chmod.c.diff
chmod 'u=rw,g=rw,o=rw' 'chmod.c.diff'
set `wc -c 'chmod.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''chmod.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'chown.c.diff'
sed 's/^X//' > 'chown.c.diff' << '+ END-OF-FILE ''chown.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE chown.c.diff
chmod 'u=rw,g=rw,o=rw' 'chown.c.diff'
set `wc -c 'chown.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''chown.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'chroot.c.diff'
sed 's/^X//' > 'chroot.c.diff' << '+ END-OF-FILE ''chroot.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE chroot.c.diff
chmod 'u=rw,g=rw,o=rw' 'chroot.c.diff'
set `wc -c 'chroot.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''chroot.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'cleanup.c.diff'
sed 's/^X//' > 'cleanup.c.diff' << '+ END-OF-FILE ''cleanup.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE cleanup.c.diff
chmod 'u=rw,g=rw,o=rw' 'cleanup.c.diff'
set `wc -c 'cleanup.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''cleanup.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'close.c.diff'
sed 's/^X//' > 'close.c.diff' << '+ END-OF-FILE ''close.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE close.c.diff
chmod 'u=rw,g=rw,o=rw' 'close.c.diff'
set `wc -c 'close.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''close.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'creat.c.diff'
sed 's/^X//' > 'creat.c.diff' << '+ END-OF-FILE ''creat.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE creat.c.diff
chmod 'u=rw,g=rw,o=rw' 'creat.c.diff'
set `wc -c 'creat.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''creat.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'ctime.c.diff'
sed 's/^X//' > 'ctime.c.diff' << '+ END-OF-FILE ''ctime.c.diff'
X1,11c1
X< struct tm {
X< int tm_sec;
X< int tm_min;
X< int tm_hour;
X< int tm_mday;
X< int tm_mon;
X< int tm_year;
X< int tm_wday;
X< int tm_yday;
X< int tm_isdst;
X< };
X---
X> #include <time.h>
X13,17c3,4
X< struct timeb {
X< long time;
X< unsigned short millitm;
X< short timezone;
X< short dstflag;
X---
X> static int days_per_month[] = {
X> 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
X18a6,12
X> static char *months[] = {
X> "Jan", "Feb", "Mar", "Apr", "May", "Jun",
X> "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
X> };
X> static char *days[] = {
X> "Thu", "Fri", "Sat", "Sun", "Mon", "Tue", "Wed"
X> };
X20,21c14,17
X< extern struct tm *localtime();
X< extern char *asctime();
X---
X> #define MIN 60L
X> #define HOUR (60 * MIN)
X> #define DAY (24 * HOUR)
X> #define YEAR (365 * DAY)
X23,24c19,21
X< char *ctime(clock)
X< long *clock;
X---
X> char *
X> ctime(pt)
X> long *pt;
X26,27c23,25
X< return asctime(localtime(clock));
X< }
X---
X> struct tm tm;
X> static char buf[26];
X> register long t = *pt;
X29,54c27,37
X< static int monthsize[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
X<
X< #define SECS_DAY (24*60L*60L)
X< #define YEARSIZE(year) ((year) % 4 ? 365 : 366)
X<
X< struct tm *
X< gmtime(clock)
X< long *clock;
X< {
X< long cl = *clock;
X< long dayclock, dayno;
X< static struct tm tm_buf;
X< register struct tm *pbuf = &tm_buf;
X< register int *months = monthsize;
X< int year = 1970;
X<
X< dayclock = cl % SECS_DAY;
X< dayno = cl / SECS_DAY;
X<
X< pbuf->tm_sec = dayclock % 60;
X< pbuf->tm_min = (dayclock % 3600) / 60;
X< pbuf->tm_hour = dayclock / 3600;
X< pbuf->tm_wday = (dayno + 4) % 7; /* day 0 was a thursday */
X< while (dayno >= YEARSIZE(year)) {
X< dayno -= YEARSIZE(year);
X< year++;
X---
X> tm.tm_year = 0;
X> tm.tm_mon = 0;
X> tm.tm_mday = 1;
X> tm.tm_hour = 0;
X> tm.tm_min = 0;
X> tm.tm_sec = 0;
X> while (t >= YEAR) {
X> if ((tm.tm_year % 4) == 2)
X> t -= DAY;
X> tm.tm_year += 1;
X> t -= YEAR;
X56,115c39,47
X< pbuf->tm_year = year - 1900;
X< pbuf->tm_yday = dayno;
X< pbuf->tm_isdst = 0;
X< if (YEARSIZE(year) == 366) monthsize[1] = 29;
X< while (dayno - *months >= 0) dayno -= *months++;
X< pbuf->tm_mday = dayno + 1;
X< pbuf->tm_mon = months - monthsize;
X< monthsize[1] = 28;
X< return pbuf;
X< }
X<
X< #define FIRSTSUNDAY(t) (((t)->tm_yday - (t)->tm_wday + 420) % 7)
X< #define SUNDAY(day, t) ((day) < 58 ? \
X< ((day) < FIRSTSUNDAY(t) ? FIRSTSUNDAY(t) :
X< static int
X< last_sunday(d, t)
X< register int d;
X< register struct tm *t;
X< {
X< int first = FIRSTSUNDAY(t);
X<
X< if (d >= 58 && YEARSIZE(t->tm_year)) d++;
X< if (d < first) return first;
X< return d - (d - first) % 7;
X< }
X<
X< extern struct tm *gmtime();
X<
X< struct tm *
X< localtime(clock)
X< long *clock;
X< {
X< register struct tm *gmt;
X< long cl;
X< int begindst, enddst;
X< extern int __daylight;
X< extern long __timezone;
X<
X< tzset();
X< cl = *clock - __timezone;
X< gmt = gmtime(&cl);
X< if (__daylight) {
X< /* daylight saving time.
X< Unfortunately, rules differ for different countries.
X< Implemented here are heuristics that got it right
X< in Holland, over the last couple of years.
X< Of course, there is no algorithm. It is all
X< politics ...
X< */
X< begindst = last_sunday(89, gmt); /* last Sun before Apr */
X< enddst = last_sunday(272, gmt); /* last Sun in Sep */
X< if ((gmt->tm_yday>begindst ||
X< (gmt->tm_yday==begindst && gmt->tm_hour>=2)) &&
X< (gmt->tm_yday<enddst ||
X< (gmt->tm_yday==enddst && gmt->tm_hour<3))) {
X< /* it all happens between 2 and 3 */
X< cl += 1*60*60;
X< gmt = gmtime(&cl);
X< gmt->tm_isdst++;
X< }
X---
X> tm.tm_year += 1970;
X> days_per_month[1] = 28;
X> if ((tm.tm_year % 4) == 0)
X> days_per_month[1]++;
X> while (t >= (days_per_month[tm.tm_mon] * DAY))
X> t -= days_per_month[tm.tm_mon++] * DAY;
X> while (t >= DAY) {
X> t -= DAY;
X> tm.tm_mday++;
X117,174c49,51
X< return gmt;
X< }
X< #ifdef BSD4_2
X< #else
X< #ifndef USG
X< #endif
X< #endif
X<
X< #ifdef USG
X< long timezone = -1 * 60;
X< int daylight = 1;
X< char *tzname[] = {"MET", "MDT",};
X< #endif
X<
X< long __timezone = -1 * 60;
X< int __daylight = 1;
X< char *__tzname[] = {"MET", "MDT", };
X<
X< tzset()
X< {
X< #ifdef BSD4_2
X< struct timeval tval;
X< struct timezone tzon;
X<
X< gettimeofday(&tval, &tzon);
X< __timezone = tzon.tz_minuteswest * 60L;
X< __daylight = tzon.tz_dsttime;
X< #else
X< #ifndef USG
X< struct timeb time;
X<
X< ftime(&time);
X< __timezone = time.timezone*60L;
X< __daylight = time.dstflag;
X< #endif
X< #endif
X<
X< {
X< extern char *getenv();
X< register char *p = getenv("TZ");
X<
X< if (p && *p) {
X< register int n = 0;
X< int sign = 1;
X<
X< strncpy(__tzname[0], p, 3);
X< p += 3;
X< if (*(p += 3) == '-') {
X< sign = -1;
X< p++;
X< }
X<
X< while(*p >= '0' && *p <= '9')
X< n = 10 * n + (*p++ - '0');
X< n *= sign;
X< __timezone = ((long)(n * 60)) * 60;
X< __daylight = (*p != '\0');
X< strncpy(__tzname[1], p, 3);
X---
X> while (t >= HOUR) {
X> t -= HOUR;
X> tm.tm_hour++;
X175a53,55
X> while (t >= MIN) {
X> t -= MIN;
X> tm.tm_min++;
X177,182c57,61
X< #ifdef USG
X< timezone = __timezone;
X< daylight = __daylight;
X< tzname[0] = __tzname[0];
X< tzname[1] = __tzname[1];
X< #endif
X---
X> tm.tm_sec = (int) t;
X> sprintf(buf, "%s %s %2d %02d:%02d:%02d %d\n",
X> days[(t / DAY) % 7], months[tm.tm_mon],
X> tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year);
X> return buf;
+ END-OF-FILE ctime.c.diff
chmod 'u=rw,g=rw,o=rw' 'ctime.c.diff'
set `wc -c 'ctime.c.diff'`
count=$1
case $count in
5390) :;;
*) echo 'Bad character count in ''ctime.c.diff' >&2
echo 'Count should be 5390' >&2
esac
echo Extracting 'ctype.c.diff'
sed 's/^X//' > 'ctype.c.diff' << '+ END-OF-FILE ''ctype.c.diff'
X1c1
X< #include "../include/ctype.h"
X---
X> #include <ctype.h>
+ END-OF-FILE ctype.c.diff
chmod 'u=rw,g=rw,o=rw' 'ctype.c.diff'
set `wc -c 'ctype.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''ctype.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'doprintf.c.diff'
sed 's/^X//' > 'doprintf.c.diff' << '+ END-OF-FILE ''doprintf.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
X3,4c3,8
X< #define MAXDIGITS 12
X< #define PRIVATE static
X---
X> /*
X> * three compile time options:
X> * STACKUP fetch arguments using *p-- instead of *p++
X> * NO_LONGD %d and %ld/%D are equal
X> * NO_FLOAT abort on %e, %f and %g
X> */
X6c10
X< /* This is the same as varargs , on BSD systems */
X---
X> #define NO_FLOAT
X8c12,16
X< #define GET_ARG(arglist,mode) ((mode *)(arglist += sizeof(mode)))[-1]
X---
X> #ifdef NO_FLOAT
X> #define MAXDIG 11 /* 32 bits in radix 8 */
X> #else
X> #define MAXDIG 128 /* this must be enough */
X> #endif
X10,13c18,22
X< _doprintf(fp, format, args)
X< FILE *fp;
X< register char *format;
X< int args;
X---
X> static char *
X> itoa(p, num, radix)
X> register char *p;
X> register unsigned num;
X> register radix;
X15,23c24,25
X< register char *vl;
X< int r,
X< w1, w2,
X< sign;
X< long l;
X< char c;
X< char *s;
X< char padchar;
X< char a[MAXDIGITS];
X---
X> register i;
X> register char *q;
X25c27,40
X< vl = (char *) args;
X---
X> q = p + MAXDIG;
X> do {
X> i = (int)(num % radix);
X> i += '0';
X> if (i > '9')
X> i += 'A' - '0' - 10;
X> *--q = i;
X> } while (num = num / radix);
X> i = p + MAXDIG - q;
X> do
X> *p++ = *q++;
X> while (--i);
X> return(p);
X> }
X27,31c42,50
X< while ( *format != '\0') {
X< if ( *format != '%' ) {
X< putc( *format++, fp );
X< continue;
X< }
X---
X> #ifndef NO_LONGD
X> static char *
X> ltoa(p, num, radix)
X> register char *p;
X> register unsigned long num;
X> register radix;
X> {
X> register i;
X> register char *q;
X33,37c52,66
X< w1 = 0;
X< w2 = 0;
X< sign = 1;
X< padchar = ' ';
X< format++;
X---
X> q = p + MAXDIG;
X> do {
X> i = (int)(num % radix);
X> i += '0';
X> if (i > '9')
X> i += 'A' - '0' - 10;
X> *--q = i;
X> } while (num = num / radix);
X> i = p + MAXDIG - q;
X> do
X> *p++ = *q++;
X> while (--i);
X> return(p);
X> }
X> #endif
X39,42c68,72
X< if ( *format == '-' ) {
X< sign = -1;
X< format++;
X< }
X---
X> #ifndef NO_FLOAT
X> extern char *_ecvt();
X> extern char *_fcvt();
X> extern char *_gcvt();
X> #endif
X44,47c74,78
X< if ( *format == '0') {
X< padchar = '0';
X< format++;
X< }
X---
X> #ifdef STACKUP
X> #define GETARG(typ) *((typ *)args)--
X> #else
X> #define GETARG(typ) *((typ *)args)++
X> #endif STACKUP
X49,52c80,98
X< while ( *format >='0' && *format <='9' ){
X< w1 = 10 * w1 + sign * ( *format - '0' );
X< format++;
X< }
X---
X> _doprintf(iop, fmt, args)
X> FILE *iop;
X> register char *fmt;
X> register int *args;
X> {
X> char buf[MAXDIG+1]; /* +1 for sign */
X> register char *p;
X> register char *s;
X> register c;
X> register i;
X> register short width;
X> register short ndigit;
X> register ndfnd;
X> register ljust;
X> register zfill;
X> #ifndef NO_LONGD
X> register lflag;
X> register long l;
X> #endif
X54,58c100,144
X< if ( *format == '.'){
X< format++;
X< while ( *format >='0' && *format <='9' ){
X< w2 = 10 * w2 + ( *format - '0' );
X< format++;
X---
X> for (;;) {
X> c = *fmt++;
X> if (c == 0)
X> return;
X> if (c != '%') {
X> putc(c, iop);
X> continue;
X> }
X> p = buf;
X> s = buf;
X> ljust = 0;
X> if (*fmt == '-') {
X> fmt++;
X> ljust++;
X> }
X> zfill = ' ';
X> if (*fmt == '0') {
X> fmt++;
X> zfill = '0';
X> }
X> for (width = 0;;) {
X> c = *fmt++;
X> if (c >= '0' && c <= '9')
X> c -= '0';
X> else if (c == '*')
X> c = GETARG(int);
X> else
X> break;
X> width *= 10;
X> width += c;
X> }
X> ndfnd = 0;
X> ndigit = 0;
X> if (c == '.') {
X> for (;;) {
X> c = *fmt++;
X> if (c >= '0' && c <= '9')
X> c -= '0';
X> else if (c == '*')
X> c = GETARG(int);
X> else
X> break;
X> ndigit *= 10;
X> ndigit += c;
X> ndfnd++;
X61,66c147,168
X<
X< switch (*format) {
X< case 'd':
X< l = (long) GET_ARG(vl, int);
X< r = 10;
X< break;
X---
X> #ifndef NO_LONGD
X> lflag = 0;
X> #endif
X> if (c == 'l' || c == 'L') {
X> #ifndef NO_LONGD
X> lflag++;
X> #endif
X> if (*fmt)
X> c = *fmt++;
X> }
X> switch (c) {
X> case 'X':
X> #ifndef NO_LONGD
X> lflag++;
X> #endif
X> case 'x':
X> c = 16;
X> goto oxu;
X> case 'U':
X> #ifndef NO_LONGD
X> lflag++;
X> #endif
X68,71c170,175
X< l = (long) GET_ARG(vl, int);
X< l = l & 0xFFFF;
X< r = 10;
X< break;
X---
X> c = 10;
X> goto oxu;
X> case 'O':
X> #ifndef NO_LONGD
X> lflag++;
X> #endif
X73,75c177,185
X< l = (long) GET_ARG(vl, int);
X< if (l < 0) l = l & 0xFFFF;
X< r = 8;
X---
X> c = 8;
X> oxu:
X> #ifndef NO_LONGD
X> if (lflag) {
X> p = ltoa(p, GETARG(long), c);
X> break;
X> }
X> #endif
X> p = itoa(p, GETARG(int), c);
X77,81d186
X< case 'x':
X< l = (long) GET_ARG(vl, int);
X< if (l < 0) l = l & 0xFFFF;
X< r = 16;
X< break;
X83,84c188,206
X< l = (long) GET_ARG(vl, long);
X< r = 10;
X---
X> #ifndef NO_LONGD
X> lflag++;
X> #endif
X> case 'd':
X> #ifndef NO_LONGD
X> if (lflag) {
X> if ((l = GETARG(long)) < 0) {
X> *p++ = '-';
X> l = -l;
X> }
X> p = ltoa(p, l, 10);
X> break;
X> }
X> #endif
X> if ((i = GETARG(int)) < 0) {
X> *p++ = '-';
X> i = -i;
X> }
X> p = itoa(p, i, 10);
X86,88c208,213
X< case 'O':
X< l = (long) GET_ARG(vl, long);
X< r = 8;
X---
X> #ifdef NO_FLOAT
X> case 'e':
X> case 'f':
X> case 'g':
X> zfill = ' ';
X> *p++ = '?';
X90,92c215,220
X< case 'X':
X< l = (long) GET_ARG(vl, long);
X< r = 16;
X---
X> #else
X> case 'e':
X> if (ndfnd == 0)
X> ndigit = 6;
X> ndigit++;
X> p = _ecvt(p, GETARG(double), ndigit);
X93a222,232
X> case 'f':
X> if (ndfnd == 0)
X> ndigit = 6;
X> p = _fcvt(p, GETARG(double), ndigit);
X> break;
X> case 'g':
X> if (ndfnd == 0)
X> ndigit = 6;
X> p = _gcvt(p, GETARG(double), ndigit);
X> break;
X> #endif
X95,99c234,236
X< c = (char) GET_ARG(vl, int);
X< /* char's are casted back to int's */
X< putc( c, fp);
X< format++;
X< continue;
X---
X> zfill = ' ';
X> *p++ = GETARG(int);
X> break;
X101,104c238,245
X< s = GET_ARG(vl, char *);
X< _printit(s,w1,w2,padchar,strlen(s),fp);
X< format++;
X< continue;
X---
X> zfill = ' ';
X> if ((s = GETARG(char *)) == 0)
X> s = "(null)";
X> if (ndigit == 0)
X> ndigit = 32767;
X> for (p = s; *p && --ndigit >= 0; p++)
X> ;
X> break;
X106,108c247,248
X< putc('%',fp);
X< putc(*format++,fp);
X< continue;
X---
X> *p++ = c;
X> break;
X110,146c250,262
X<
X< _bintoascii (l, r, a);
X< _printit(a,w1,w2,padchar,strlen(a),fp);
X< format++;
X< }
X< }
X<
X<
X<
X< PRIVATE _bintoascii (num, radix, a)
X< long num;
X< int radix;
X< char *a;
X< {
X< char b[MAXDIGITS];
X< int hit, negative;
X< register int n, i;
X<
X< negative = 0;
X< if (num == 0) {
X< a[0] = '0';
X< a[1] = '\0';
X< return;
X< }
X< if (radix == 10) {
X< if (num < 0) {num = -num; negative++;}
X< }
X<
X< for (n = 0; n < MAXDIGITS; n++)
X< b[n] = 0;
X<
X< n = 0;
X<
X< do {
X< if (radix == 10) {
X< b[n] = num % 10;
X< num = (num - b[n]) / 10;
X---
X> i = p - s;
X> if ((width -= i) < 0)
X> width = 0;
X> if (ljust == 0)
X> width = -width;
X> if (width < 0) {
X> if (*s == '-' && zfill == '0') {
X> putc(*s++, iop);
X> i--;
X> }
X> do
X> putc(zfill, iop);
X> while (++width != 0);
X148,150c264,268
X< if (radix == 8) {
X< b[n] = num & 0x7;
X< num = (num >> 3) & 0x1FFFFFFF;
X---
X> while (--i >= 0)
X> putc(*s++, iop);
X> while (width) {
X> putc(zfill, iop);
X> width--;
X152,172d269
X< if (radix == 16) {
X< b[n] = num & 0xF;
X< num = (num >> 4) & 0x0FFFFFFF;
X< }
X< n++;
X< }
X< while (num != 0);
X<
X< /* Convert to ASCII. */
X< hit = 0;
X< for (i = n - 1; i >= 0; i--) {
X< if (b[i] == 0 && hit == 0) {
X< b[i] = ' ';
X< }
X< else {
X< if (b[i] < 10)
X< b[i] += '0';
X< else
X< b[i] += 'A' - 10;
X< hit++;
X< }
X174,217d270
X< if (negative)
X< b[n++] = '-';
X<
X< for(i = n - 1 ; i >= 0 ; i-- )
X< *a++ = b[i];
X<
X< *a = '\0';
X<
X< }
X<
X<
X< PRIVATE _printit(str, w1, w2, padchar, length, file)
X< char *str;
X< int w1, w2;
X< char padchar;
X< int length;
X< FILE *file;
X< {
X< int len2 = length;
X< int temp;
X<
X< if ( w2 > 0 && length > w2)
X< len2 = w2;
X<
X< temp = len2;
X<
X< if ( w1 > 0 )
X< while ( w1 > len2 ){
X< --w1;
X< putc(padchar,file);
X< }
X<
X< while ( *str && ( len2-- != 0 ))
X< putc(*str++, file);
X<
X< if ( w1 < 0 )
X< if ( padchar == '0' ){
X< putc('.',file);
X< w1++;
X< }
X< while ( w1 < -temp ){
X< w1++;
X< putc(padchar,file);
X< }
+ END-OF-FILE doprintf.c.diff
chmod 'u=rw,g=rw,o=rw' 'doprintf.c.diff'
set `wc -c 'doprintf.c.diff'`
count=$1
case $count in
8375) :;;
*) echo 'Bad character count in ''doprintf.c.diff' >&2
echo 'Count should be 8375' >&2
esac
echo Extracting 'dup.c.diff'
sed 's/^X//' > 'dup.c.diff' << '+ END-OF-FILE ''dup.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE dup.c.diff
chmod 'u=rw,g=rw,o=rw' 'dup.c.diff'
set `wc -c 'dup.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''dup.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'dup2.c.diff'
sed 's/^X//' > 'dup2.c.diff' << '+ END-OF-FILE ''dup2.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE dup2.c.diff
chmod 'u=rw,g=rw,o=rw' 'dup2.c.diff'
set `wc -c 'dup2.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''dup2.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'exec.c.diff'
sed 's/^X//' > 'exec.c.diff' << '+ END-OF-FILE ''exec.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
X3c3
X< char *nullptr[1]; /* the EXEC calls need a zero pointer */
X---
X> extern char **environ; /* environment pointer */
X4a5,6
X> #define PTRSIZE sizeof(char *)
X>
X9c11
X< return execve(name, &arg0, nullptr);
X---
X> return execve(name, &arg0, environ);
X24c26
X< return execve(name, argv, nullptr);
X---
X> return execve(name, argv, environ);
X35c37,38
X< int i, nargs, nenvps, stackbytes, ptrsize, offset;
X---
X> int i, nargs, nenvps, stackbytes, offset;
X> extern errno;
X44d46
X< ptrsize = sizeof(NIL_PTR);
X47,48c49,53
X< hp = &stack[(nargs + nenvps + 3) * ptrsize];
X< if (hp + nargs + nenvps >= &stack[MAX_ISTACK_BYTES]) return(E2BIG);
X---
X> hp = &stack[(nargs + nenvps + 3) * PTRSIZE];
X> if (hp + nargs + nenvps >= &stack[MAX_ISTACK_BYTES]) {
X> errno = E2BIG;
X> return(-1);
X> }
X59c64,67
X< if (hp >= &stack[MAX_ISTACK_BYTES]) return(E2BIG);
X---
X> if (hp >= &stack[MAX_ISTACK_BYTES]) {
X> errno = E2BIG;
X> return(-1);
X> }
X72c80,83
X< if (hp >= &stack[MAX_ISTACK_BYTES]) return(E2BIG);
X---
X> if (hp >= &stack[MAX_ISTACK_BYTES]) {
X> errno = E2BIG;
X> return(-1);
X> }
X77c88
X< stackbytes = ( ( (hp - stack) + ptrsize - 1)/ptrsize) * ptrsize;
X---
X> stackbytes = ( ( (int)(hp - stack) + PTRSIZE - 1)/PTRSIZE) * PTRSIZE;
X89c100
X< char stack[4];
X---
X> static char stack[3 * PTRSIZE];
X91,95c102
X< stack[0] = 0;
X< stack[1] = 0;
X< stack[2] = 0;
X< stack[3] = 0;
X< return callm1(MM_PROC_NR, EXEC, len(name), 4, 0, name, stack, NIL_PTR);
X---
X> return callm1(MM_PROC_NR, EXEC, len(name), sizeof(stack), 0, name, stack, NIL_PTR);
+ END-OF-FILE exec.c.diff
chmod 'u=rw,g=rw,o=rw' 'exec.c.diff'
set `wc -c 'exec.c.diff'`
count=$1
case $count in
1631) :;;
*) echo 'Bad character count in ''exec.c.diff' >&2
echo 'Count should be 1631' >&2
esac
echo Extracting 'exit.c.diff'
sed 's/^X//' > 'exit.c.diff' << '+ END-OF-FILE ''exit.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
X2a3,4
X> PUBLIC int (*__cleanup)();
X>
X5a8
X> if (__cleanup) (*__cleanup)();
X7a11,17
X>
X> PUBLIC int _exit(status)
X> int status;
X> {
X> return callm1(MM, EXIT, status, 0, 0, NIL_PTR, NIL_PTR, NIL_PTR);
X> }
X>
+ END-OF-FILE exit.c.diff
chmod 'u=rw,g=rw,o=rw' 'exit.c.diff'
set `wc -c 'exit.c.diff'`
count=$1
case $count in
267) :;;
*) echo 'Bad character count in ''exit.c.diff' >&2
echo 'Count should be 267' >&2
esac
echo Extracting 'fclose.c.diff'
sed 's/^X//' > 'fclose.c.diff' << '+ END-OF-FILE ''fclose.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
X19c19
X< free(fp);
X---
X> if (i > 2) free(fp);
+ END-OF-FILE fclose.c.diff
chmod 'u=rw,g=rw,o=rw' 'fclose.c.diff'
set `wc -c 'fclose.c.diff'`
count=$1
case $count in
108) :;;
*) echo 'Bad character count in ''fclose.c.diff' >&2
echo 'Count should be 108' >&2
esac
echo Extracting 'fflush.c.diff'
sed 's/^X//' > 'fflush.c.diff' << '+ END-OF-FILE ''fflush.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE fflush.c.diff
chmod 'u=rw,g=rw,o=rw' 'fflush.c.diff'
set `wc -c 'fflush.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''fflush.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'fgets.c.diff'
sed 's/^X//' > 'fgets.c.diff' << '+ END-OF-FILE ''fgets.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE fgets.c.diff
chmod 'u=rw,g=rw,o=rw' 'fgets.c.diff'
set `wc -c 'fgets.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''fgets.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'fopen.c.diff'
sed 's/^X//' > 'fopen.c.diff' << '+ END-OF-FILE ''fopen.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
X3c3
X< #define PMODE 0644
X---
X> #define PMODE 0666
X28d27
X< flags |= WRITEMODE;
X30c29,30
X< return(NULL);
X---
X> if(errno != ENOENT || (fd = creat(name, PMODE)) < 0)
X> return(NULL);
+ END-OF-FILE fopen.c.diff
chmod 'u=rw,g=rw,o=rw' 'fopen.c.diff'
set `wc -c 'fopen.c.diff'`
count=$1
case $count in
259) :;;
*) echo 'Bad character count in ''fopen.c.diff' >&2
echo 'Count should be 259' >&2
esac
echo Extracting 'fork.c.diff'
sed 's/^X//' > 'fork.c.diff' << '+ END-OF-FILE ''fork.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE fork.c.diff
chmod 'u=rw,g=rw,o=rw' 'fork.c.diff'
set `wc -c 'fork.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''fork.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'fprintf.c.diff'
sed 's/^X//' > 'fprintf.c.diff' << '+ END-OF-FILE ''fprintf.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE fprintf.c.diff
chmod 'u=rw,g=rw,o=rw' 'fprintf.c.diff'
set `wc -c 'fprintf.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''fprintf.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'fputs.c.diff'
sed 's/^X//' > 'fputs.c.diff' << '+ END-OF-FILE ''fputs.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE fputs.c.diff
chmod 'u=rw,g=rw,o=rw' 'fputs.c.diff'
set `wc -c 'fputs.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''fputs.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'fread.c.diff'
sed 's/^X//' > 'fread.c.diff' << '+ END-OF-FILE ''fread.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE fread.c.diff
chmod 'u=rw,g=rw,o=rw' 'fread.c.diff'
set `wc -c 'fread.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''fread.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'freopen.c.diff'
sed 's/^X//' > 'freopen.c.diff' << '+ END-OF-FILE ''freopen.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE freopen.c.diff
chmod 'u=rw,g=rw,o=rw' 'freopen.c.diff'
set `wc -c 'freopen.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''freopen.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'fseek.c.diff'
sed 's/^X//' > 'fseek.c.diff' << '+ END-OF-FILE ''fseek.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
X21,23c21
X< pos += count - lseek(fileno(iop), 0L,1) - 1;
X< /*^^^ This caused the problem : - 1 corrected
X< it */
X---
X> pos += count - lseek(fileno(iop), 0L, 1);
+ END-OF-FILE fseek.c.diff
chmod 'u=rw,g=rw,o=rw' 'fseek.c.diff'
set `wc -c 'fseek.c.diff'`
count=$1
case $count in
243) :;;
*) echo 'Bad character count in ''fseek.c.diff' >&2
echo 'Count should be 243' >&2
esac
echo Extracting 'fstat.c.diff'
sed 's/^X//' > 'fstat.c.diff' << '+ END-OF-FILE ''fstat.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE fstat.c.diff
chmod 'u=rw,g=rw,o=rw' 'fstat.c.diff'
set `wc -c 'fstat.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''fstat.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'ftell.c.diff'
sed 's/^X//' > 'ftell.c.diff' << '+ END-OF-FILE ''ftell.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE ftell.c.diff
chmod 'u=rw,g=rw,o=rw' 'ftell.c.diff'
set `wc -c 'ftell.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''ftell.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'fwrite.c.diff'
sed 's/^X//' > 'fwrite.c.diff' << '+ END-OF-FILE ''fwrite.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE fwrite.c.diff
chmod 'u=rw,g=rw,o=rw' 'fwrite.c.diff'
set `wc -c 'fwrite.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''fwrite.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'getc.c.diff'
sed 's/^X//' > 'getc.c.diff' << '+ END-OF-FILE ''getc.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
X16c16
X< if (--iop->_count <= 0){
X---
X> if (iop->_count <= 0){
X38c38
X< return (*iop->_ptr++ & CMASK);
X---
X> return (--iop->_count, *iop->_ptr++ & CMASK);
+ END-OF-FILE getc.c.diff
chmod 'u=rw,g=rw,o=rw' 'getc.c.diff'
set `wc -c 'getc.c.diff'`
count=$1
case $count in
220) :;;
*) echo 'Bad character count in ''getc.c.diff' >&2
echo 'Count should be 220' >&2
esac
echo Extracting 'getegid.c.diff'
sed 's/^X//' > 'getegid.c.diff' << '+ END-OF-FILE ''getegid.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE getegid.c.diff
chmod 'u=rw,g=rw,o=rw' 'getegid.c.diff'
set `wc -c 'getegid.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''getegid.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'geteuid.c.diff'
sed 's/^X//' > 'geteuid.c.diff' << '+ END-OF-FILE ''geteuid.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE geteuid.c.diff
chmod 'u=rw,g=rw,o=rw' 'geteuid.c.diff'
set `wc -c 'geteuid.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''geteuid.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'getgid.c.diff'
sed 's/^X//' > 'getgid.c.diff' << '+ END-OF-FILE ''getgid.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE getgid.c.diff
chmod 'u=rw,g=rw,o=rw' 'getgid.c.diff'
set `wc -c 'getgid.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''getgid.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'getgrent.c.diff'
sed 's/^X//' > 'getgrent.c.diff' << '+ END-OF-FILE ''getgrent.c.diff'
X7c7
X< #include "../include/grp.h"
X---
X> #include <grp.h>
X76c76
X< grp.name = _buf;
X---
X> grp.gr_name = _buf;
X78c78
X< grp.passwd = _buf;
X---
X> grp.gr_passwd = _buf;
X80c80
X< grp.gid = atoi (_buf);
X---
X> grp.gr_gid = atoi (_buf);
X92c92
X< if (!strcmp (grp -> name, name))
X---
X> if (!strcmp (grp -> gr_name, name))
X108c108
X< if (grp -> gid == gid)
X---
X> if (grp -> gr_gid == gid)
+ END-OF-FILE getgrent.c.diff
chmod 'u=rw,g=rw,o=rw' 'getgrent.c.diff'
set `wc -c 'getgrent.c.diff'`
count=$1
case $count in
458) :;;
*) echo 'Bad character count in ''getgrent.c.diff' >&2
echo 'Count should be 458' >&2
esac
echo Extracting 'getpass.c.diff'
sed 's/^X//' > 'getpass.c.diff' << '+ END-OF-FILE ''getpass.c.diff'
X1c1
X< #include "../h/sgtty.h"
X---
X> #include <sgtty.h>
+ END-OF-FILE getpass.c.diff
chmod 'u=rw,g=rw,o=rw' 'getpass.c.diff'
set `wc -c 'getpass.c.diff'`
count=$1
case $count in
55) :;;
*) echo 'Bad character count in ''getpass.c.diff' >&2
echo 'Count should be 55' >&2
esac
echo Extracting 'getpid.c.diff'
sed 's/^X//' > 'getpid.c.diff' << '+ END-OF-FILE ''getpid.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE getpid.c.diff
chmod 'u=rw,g=rw,o=rw' 'getpid.c.diff'
set `wc -c 'getpid.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''getpid.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'getpwent.c.diff'
sed 's/^X//' > 'getpwent.c.diff' << '+ END-OF-FILE ''getpwent.c.diff'
X9c9
X< #include "../include/pwd.h"
X---
X> #include <pwd.h>
+ END-OF-FILE getpwent.c.diff
chmod 'u=rw,g=rw,o=rw' 'getpwent.c.diff'
set `wc -c 'getpwent.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''getpwent.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'gets.c.diff'
sed 's/^X//' > 'gets.c.diff' << '+ END-OF-FILE ''gets.c.diff'
X1c1
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
X13c13
X< if (ch == EOF && ptr==str)
X---
X> if (ch == EOF)
+ END-OF-FILE gets.c.diff
chmod 'u=rw,g=rw,o=rw' 'gets.c.diff'
set `wc -c 'gets.c.diff'`
count=$1
case $count in
119) :;;
*) echo 'Bad character count in ''gets.c.diff' >&2
echo 'Count should be 119' >&2
esac
echo Extracting 'getuid.c.diff'
sed 's/^X//' > 'getuid.c.diff' << '+ END-OF-FILE ''getuid.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE getuid.c.diff
chmod 'u=rw,g=rw,o=rw' 'getuid.c.diff'
set `wc -c 'getuid.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''getuid.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'ioctl.c.diff'
sed 's/^X//' > 'ioctl.c.diff' << '+ END-OF-FILE ''ioctl.c.diff'
X1,3c1,3
X< #include "../include/lib.h"
X< #include "../h/com.h"
X< #include "../include/sgtty.h"
X---
X> #include "lib.h"
X> #include <minix/com.h>
X> #include <sgtty.h>
+ END-OF-FILE ioctl.c.diff
chmod 'u=rw,g=rw,o=rw' 'ioctl.c.diff'
set `wc -c 'ioctl.c.diff'`
count=$1
case $count in
163) :;;
*) echo 'Bad character count in ''ioctl.c.diff' >&2
echo 'Count should be 163' >&2
esac
echo Extracting 'isatty.c.diff'
sed 's/^X//' > 'isatty.c.diff' << '+ END-OF-FILE ''isatty.c.diff'
X1c1,3
X< #include "../include/stat.h"
X---
X> #include "lib.h"
X> #include <minix/com.h>
X> #include <sgtty.h>
X6,11c8,10
X< struct stat s;
X<
X< fstat(fd, &s);
X< if ( (s.st_mode&S_IFMT) == S_IFCHR)
X< return(1);
X< else
X---
X> M.TTY_REQUEST = TIOCGETP;
X> M.TTY_LINE = fd;
X> if (callx(FS, IOCTL) < 0)
X12a12
X> return(1);
+ END-OF-FILE isatty.c.diff
chmod 'u=rw,g=rw,o=rw' 'isatty.c.diff'
set `wc -c 'isatty.c.diff'`
count=$1
case $count in
326) :;;
*) echo 'Bad character count in ''isatty.c.diff' >&2
echo 'Count should be 326' >&2
esac
echo Extracting 'kill.c.diff'
sed 's/^X//' > 'kill.c.diff' << '+ END-OF-FILE ''kill.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE kill.c.diff
chmod 'u=rw,g=rw,o=rw' 'kill.c.diff'
set `wc -c 'kill.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''kill.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'link.c.diff'
sed 's/^X//' > 'link.c.diff' << '+ END-OF-FILE ''link.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE link.c.diff
chmod 'u=rw,g=rw,o=rw' 'link.c.diff'
set `wc -c 'link.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''link.c.diff' >&2
echo 'Count should be 57' >&2
esac
echo Extracting 'lseek.c.diff'
sed 's/^X//' > 'lseek.c.diff' << '+ END-OF-FILE ''lseek.c.diff'
X1c1
X< #include "../include/lib.h"
X---
X> #include "lib.h"
+ END-OF-FILE lseek.c.diff
chmod 'u=rw,g=rw,o=rw' 'lseek.c.diff'
set `wc -c 'lseek.c.diff'`
count=$1
case $count in
57) :;;
*) echo 'Bad character count in ''lseek.c.diff' >&2
echo 'Count should be 57' >&2
esac
exit 0