#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/libc/9sys/getwd.c /n/dump/1995/0819/sys/src/libc/9sys/getwd.c # srcdir: /n/juke/plan_9/sys/src/libc/9sys # version: 811713696 # date: Thu Sep 21 16:01:36 EDT 1995 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 811713696 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/sys/src/libc/9sys case 1 srcdir=$1 case * usage } if(! ~ $doextract yes){ echo This shell file contains a bundle of diffs representing changes echo to original source files in the Plan 9 distribution. It will run echo against the files in echo ' ' $srcdir echo '(unless overridden by the optional source directory argument)' echo and create a directory 811713696 containing the updated files. echo It will NOT automatically update the original files. echo echo Invoke with argument -X to perform the actual extraction. exit 0 } rm -rf 811713696 mkdir 811713696 target=811713696/getwd.c echo -n '811713696/getwd.c: ' if(! test -f $srcdir/getwd.c || ! test -r $srcdir/getwd.c){ echo $srcdir/getwd.c unreadable exit unreadable } sum=`{sum < $srcdir/getwd.c} if(! ~ d13c40b92759 $sum(1)^$sum(2)){ echo $srcdir/getwd.c is not the original distribution file exit original } cp $srcdir/getwd.c 811713696/getwd.c ed 811713696/getwd.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM getwd.c' 65c strncpy(s, "buffer too small", size + l + 1); . wq //GO.SYSIN DD VADIM getwd.c sum=`{sum < 811713696/getwd.c} if(~ 54b973112774 $sum(1)^$sum(2)) echo if not{ echo 811713696/getwd.c checksum error creating updated file exit checksum }