#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1996-05-08 19:08 MET DST by <leo@orion>.
# Source directory was `/tmp_mnt/home/godzilla/leo/tmp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   4320 -rw-r--r-- icequote-1.1.1/README
#   3828 -rw-r--r-- icequote-1.1.1/iceidx.c
#   4699 -rw-r--r-- icequote-1.1.1/icequote.c
#   1098 -rw-r--r-- icequote-1.1.1/Makefile
#   1767 -rwxr-xr-x icequote-1.1.1/quotify
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh12174; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= icequote-1.1.1/README ==============
if test ! -d 'icequote-1.1.1'; then
  $echo 'x -' 'creating directory' 'icequote-1.1.1'
  mkdir 'icequote-1.1.1'
fi
if test -f 'icequote-1.1.1/README' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'icequote-1.1.1/README' '(file already exists)'
else
  $echo 'x -' extracting 'icequote-1.1.1/README' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'icequote-1.1.1/README' &&
X
Release notes for IceQuote V1.1.1 (08-05-96):
X
Bug fix: The icequote program opened the index file for writing, when in
fact it only used the file for reading. This meant that under Unix the
person or process running icequote always needed write permission for the
index file. For single users this is always the case (which is why it took
three years for this problem to surface :-)), but for e.g. cgi-scripts
used on L-Space Web the situation is different.
X
---------------------------------------------------------------------------
X
[ Release notes for new versions of IceQuote appear at the bottom of
X  this file ]
X
XFrom: rdippold@qualcom.qualcomm.com (Ron Dippold)
Newsgroups: alt.fan.pratchett
Subject: The Pratchett Quote File (programs)
Date: 2 Feb 93 07:15:25 GMT
Organization: Qualcomm, Inc., San Diego, CA
X
Alright, here are two programs I use to index and select my random
X.sig quotes.  These aren't the whole package, but they're the vital
parts.  They should run on most C compilers, although you might have
to change the random number seeder for yours.
X
All you need is a file with the quotes in it.  Each quote must be
terminated with a "#" on its last line.  Each line must be 79
characters or less.  This allows quotes to be of almost unlimited
length, with all the spacing you want, as long as they don't require a
"#". 
X
Here's part of a quote file:
X
A man wrapped up in himself makes a very small package.#
A man's house is his hassle.#
A man's only as old as the woman he feels.#
A man's womenfolk, whatever their outward show of respect for his merit and
authority, always regard him secretly as an ass, and with something akin to
pity. -- H.L. Mencken#
A man, a plan, a canal.  Suez!#
A manager does the thing right.  A leader does the right thing.
X                      -- Anonymous (the great Greek philosopher)#
A mathematician is a machine for converting coffee into theorems.#
X
X
Then once you have your file, say pqf.quo for TP books, you index it:
X
X	iceidx pqf.quo pqf.idx
X
Then whenever you want a quote you call the random quote generator
X
X	icequote pqf.quo pqf.idx
X
It's that simple!  The reason I make you give the name of the quote
file and index file on each invocation is so you can have multiple
files of quotes for different occasions - make life easy on yourself
by turning them into batch or script files!
X
---------------------------------------------------------------------------
X
Additional comments by Leo Breebaart:
X
I have taken Ron's two source files and added a simple Makefile to them
that should work on most, if not all platforms (or so I hope).
X
If the Makefile doesn't work for you, or if you don't have a make
utility, then just compile the two .c files by hand -- as long as you
have a C compiler there should be no problem.
X
The "make tp" target will try to quotify the Pratchett Quote File for
you. In order for this to work correctly you will need to have a copy
of (or a link to) the PQF in this directory (the file should be called
'pqf'). You will also need the Unix 'awk' utility. If you don't have
that, just load the PQF into your favourite editor and manually add
'#' characters to it as described by Ron above.
X
Comments about the .c files should go to Ron (rdippold@qualcom.qualcomm.com), 
comments about the Makefile, the 'quotify' script or the PQF itself should 
go to me at leo@cp.tn.tudelft.nl.
X
Have fun!
----------------------------------------------------------------------------
X
Release notes for IceQuote V1.1 (27-07-93):
X
Some of the quotes in the PQF (or in any other quote file) are quite
large. People who use the IceQuote package to insert a quote in their
X.signature may run into aesthetic or news-software problems if the quotes
are too long.
X
Therefore I have added an option to the icequote program: you can now
specify an optional third 'maxlines' argument, which should be an
integer number greater than zero, e.g:
X
X	icequote pqf.quo pqf.idx 2
X
As a result, icequote will not print any quotes that have more than
2 lines. If you omit the maxlines argument, the program's defaults
back to its previous behaviour, and every quote is eligible. 
X
There is no noticeable speed penalty, but the size of the index file
is now double of what it was in V1.0.
X
---------------------------------------------------------------------------
SHAR_EOF
  $shar_touch -am 0508190796 'icequote-1.1.1/README' &&
  chmod 0644 'icequote-1.1.1/README' ||
  $echo 'restore of' 'icequote-1.1.1/README' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'icequote-1.1.1/README:' 'MD5 check failed'
1dc5d42543275030ec867187f8a9fb94  icequote-1.1.1/README
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'icequote-1.1.1/README'`"
    test 4320 -eq "$shar_count" ||
    $echo 'icequote-1.1.1/README:' 'original size' '4320,' 'current size' "$shar_count!"
  fi
fi
# ============= icequote-1.1.1/iceidx.c ==============
if test -f 'icequote-1.1.1/iceidx.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'icequote-1.1.1/iceidx.c' '(file already exists)'
else
  $echo 'x -' extracting 'icequote-1.1.1/iceidx.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'icequote-1.1.1/iceidx.c' &&
/*---------------------------------------------------------------------*/
/* Ron Dippold - (c) Copyright 1991,92,93 - All Rights Reserved        */
/*                                                                     */
/* ICEIDX 1.1 -  Index quote file (ICEQUOTE.TXT) into index file       */
/*               (ICEQUOTE.IDX)                                        */
/*                                                                     */
/* Compile this program in the compact model (DOS).                    */
/* This program compiles under standard DOS and UNIX compilers.  It    */
/* should work with any standard C compiler, but I can't guarantee it. */
/*                                                                     */
/* This is part of the IceQuote package.                               */
/*---------------------------------------------------------------------*/
#define VERSION "IceIdx V1.1 - Quote Compiler (c)1991,92,93 Ron Dippold\n"
X
/*
X * Changes by Leo Breebaart, 27-07-93:
X *
X * - Use two longs per quote in the index file, and save the
X *   length of the quote (in lines) in the second slot.
X *
X * - Up the VERSION string to V1.1, and add 93 to Copyright messages.
X *
X */
X
#include <stdio.h>
#include <sys/types.h>  /* for random numbers */
#include <sys/timeb.h>  /* for random numbers */
X
struct timeb rtime;     /* for random numbers */
X
#define MSG(arg) fprintf( stderr, arg )
#define SEEK_SET 0
X
void main( argc, argv )
int argc;
char **argv;
{
X	FILE *fin, *fout;
X	int i;
X	long int pos, num, line;
X	char str[100];
X
X  unsigned int cnt[10], len;
X
X
X  MSG( VERSION );
X  if( argc!=3 ) {
X    printf("   Usage:  ICEIDX <quote file name> <index file name>\n");
X    printf(" This will take the quote file and generate a corresponding\n");
X    printf(" index file from it.\n");
X    exit(9);
X  }
X
X  if( !( fin = fopen( argv[1],"rt" ) ) ) {
X    printf( "Can't open quote file %s!\n", argv[1] );
X		exit( 1 );
X	};
X  if( !( fout = fopen( argv[2],"wb" ) ) ) {
X		printf( "Can't create index file %s!\n", argv[2] );
X		exit( 2 );
X	};
X	fseek( fin, 0L, SEEK_SET );
X	num=line=0;
X	fwrite( &num, sizeof( num ), 1, fout ); /* save space for count */
X	fwrite( &num, sizeof( num ), 1, fout ); /* save space for seed */
X
X	for( len=0; len<10; cnt[len++]=0 );
X
X	len = 0;
X	fwrite( &num, sizeof( num ), 1, fout ); /* first quote at 0 */
X	do {
X		if ( !fgets( str, 99, fin ) ) {
X			break;
X		}
X		line++;
X
X		if ( str[0] != '\n' ) {
X
X			for( i=0; i<80; i++ ) {
X				if( str[i]=='#' ) {
X					num++;
X					if ( num>32767 ) {
X						printf( "Sorry, 32767 quotes maximum!\n" );
X						fclose( fin ); fclose( fout );
X						exit( 5 );
X					}
X					if( num%100 == 0 ) {
X						fprintf( stderr,"%6ld\b\b\b\b\b\b", num );
X					}
X					pos = ftell( fin);
X					fwrite( &len, sizeof( len ), 1, fout );
X					fwrite( &pos, sizeof( pos ), 1, fout );
X					if( len<10 ) {
X						cnt[len]++;
X					} else {
X						cnt[9]++;
X					}
X					len = 0;
X					break;
X				}
X				if( str[i]=='\n' ) {
X					len++;
X					break;
X				}
X			}
X
X			if( i==80 ) {
X				printf( "Hey, line %d is too long!\n", line );
X				puts(str);
X				fclose( fin ); fclose( fout );
X				exit( 3 );
X			}
X		}
X	} while ( 1 ); /* do */
X
X  /* write the number of quotes*/
X	fseek( fout, 0L, SEEK_SET );
X	fwrite( &num, sizeof( num ), 1, fout );
X
X  /* time randomization - these two lines may have to be changed for your */
X  /* C compiler                                                           */
X  ftime( &rtime );
X	srand( ( int ) ( rtime.time + rtime.millitm) );
X
X
X	i = rand()%num +2;         /* choose a random time */
X	fwrite( &i, sizeof( i ), 1, fout );
X
X	fclose( fin ); fclose( fout );
X	printf( "All done, %ld quotes.\n\n", num );
X
X	printf( "By number of lines:\n");
X	for( len=0; len<10; len++ ) {
X		if( cnt[len]>0) {
X			printf( "  %c: %5u\n", "123456789>"[len], cnt[len]);
X		}
X	}
X	exit(0);
}
SHAR_EOF
  $shar_touch -am 0508190496 'icequote-1.1.1/iceidx.c' &&
  chmod 0644 'icequote-1.1.1/iceidx.c' ||
  $echo 'restore of' 'icequote-1.1.1/iceidx.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'icequote-1.1.1/iceidx.c:' 'MD5 check failed'
04d8ce25a40d9a82948f9c6dbdd1e841  icequote-1.1.1/iceidx.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'icequote-1.1.1/iceidx.c'`"
    test 3828 -eq "$shar_count" ||
    $echo 'icequote-1.1.1/iceidx.c:' 'original size' '3828,' 'current size' "$shar_count!"
  fi
fi
# ============= icequote-1.1.1/icequote.c ==============
if test -f 'icequote-1.1.1/icequote.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'icequote-1.1.1/icequote.c' '(file already exists)'
else
  $echo 'x -' extracting 'icequote-1.1.1/icequote.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'icequote-1.1.1/icequote.c' &&
/*---------------------------------------------------------------------*/
/* Ron Dippold - (c) Copyright 1991,92,93 - All Rights Reserved        */
/*                                                                     */
/* ICEQUOTE 1.1.1 - Generate a quote from the quote file               */
/*                  (ICEQUOTE.TXT)and index file (ICEQUOTE.IDX)        */
/*                                                                     */
/* Compile under the small model (DOS)                                 */
/* This program compiles under standard DOS and UNIX compilers.  It    */
/* should work with any standard C compiler, but I can't guarantee it. */
/*                                                                     */
/* This is part of the IceQuote package.                               */
/*---------------------------------------------------------------------*/
#define VERSION "IceQuote V1.1 - Copyright (c)1991,92,93 Ron Dippold\n"
X
/*
X * Changes by Leo Breebaart, 08-05-96:
X *
X * - Index file was opened for writing, which means that
X *   wanting to run icequote meant you had to have write
X *   permission on the file. Not good for cgi-scripts...
X *
X * Changes by Leo Breebaart, 27-07-93:
X *
X * - Use new index file format (two longs per quote with the
X *   length of the quote (in lines) in the second slot).
X * 
X * - Accept optional last integer argument maxlines. IceQuote will
X *   never produce any quotes longer than maxlines.
X * 
X * - Removed redundant #include of stdio.h.
X *
X * - Up the VERSION string to V1.1, and add 93 to Copyright messages.
X *
X */
X
#include <stdio.h>
#include <sys/types.h>  /* for random numbers */
#include <sys/timeb.h>  /* for random numbers */
X
static struct timeb rtime;  /* for random numbers */
X
#define SEEK_SET 0
X
#define BADEXIT() fclose( fin ); exit( 1 );
X
X  FILE *fin;
X  long int num, pos, len;
X  char str[100];
X  int i, done, maxlen=512;
X
X
void main( argc, argv)
int argc;
char **argv;
{
X  extern int atoi();
X
X    /* Last argument is optional. Wanted to use getopt() here, but am not 
X     * sure if DOS compilers could handle that -- Leo
X     */
X  if( argc < 3 || argc > 4) {
X    printf( VERSION );
X    printf("  Usage: ICEQUOTE <quotefile> <indexfile> [<maxlines>]\n");
X    printf("  Where the index file has been generated by ICEIDX\n");
X    printf("  and where maxlines (optional) is a number larger than zero\n");
X    exit(9);
X  }
X
X    /* If last argument is present, it must be an integer > 0 */
X  if (argc == 4) {
X    if ((maxlen = atoi(argv[3])) <= 0) { 
X      fprintf( stderr, "  Optional last argument should be a positive integer, not: \"%s\".\n", argv[3] );
X      BADEXIT();
X    }
X    maxlen--; /* Saves us a (maxlen - 1) in the loop condition below */
X  }
X
X  if( !( fin = fopen( argv[2], "r" ) ) ) {
X    fprintf( stderr, "  Can't open index file %s.\n", argv[2] );
X    BADEXIT();
X  }
X
X  fseek( fin, 0L, SEEK_SET );
X
X  if ( fread( &num, sizeof( num ), 1, fin ) != 1 ) {
X    fprintf( stderr, "  Error reading index file %s.\n", argv[2] );
X    BADEXIT();
X  }
X
X  if ( num>32767 ) {
X    fprintf( stderr, "  Sorry, 32767 quotes maximum!\n" );
X    BADEXIT();
X  }
X
X  if ( fread( &pos, sizeof( pos ), 1, fin ) != 1 ) {
X    fprintf( stderr, "  Error reading index file %s.\n", argv[2] );
X    BADEXIT();
X  }
X
X  /* this is the random number seeding - you may have to recode these */
X  /* two lines for your C compiler */
X  ftime( &rtime );
X	srand( ( int ) ( rtime.time + rtime.millitm ) );
X
X  do {
X  /* not very good, but it doesn't have to be */
X  for(i=0; i<5; i++ ) {
X    pos+= rand()%0xff;
X	}
X  
X    pos = 2 * pos%num + 2; /* Uneven positions in index file contain
X			      quote lengths */
X  
X	fseek( fin, ( long ) sizeof( pos ), SEEK_SET );
X	fwrite( &pos, sizeof( pos ), 1, fin );
X
X	fseek( fin, pos*sizeof( pos ), SEEK_SET );
X
X  
X      if ( fread( &pos, sizeof( pos ), 1, fin ) != 1 ) {
X	fprintf( stderr, "  Error reading index file %s.\n", argv[2] );
X	BADEXIT();
X      }
X      if ( fread( &len, sizeof( len ), 1, fin ) != 1 ) {
X	fprintf( stderr, "  Error reading index file %s.\n", argv[2] );
X	BADEXIT();
X      }
X  } while (len > maxlen);
X
X  fclose( fin );
X
X  if( !( fin = fopen( argv[1], "rt" ) ) ) {
X    fprintf( stderr, "  Can't open quote file %s.\n", argv[1] );
X    BADEXIT();
X  }
X  
X  fseek( fin, pos, SEEK_SET );
X  done = 0;
X
X  do {
X    if ( !fgets( str, 100, fin ) ) {
X      fprintf( stderr, "  Error reading quote from %s.  Have you run ICEIDX lately?\n",
X          argv[1] );
X      BADEXIT();
X    }
X    str[81] = '\0';
X    for( i=0; i<81; i++ ) {
X      if ( str[i]=='#' ) {
X        str[i] = '\0';
X				done = 1;
X				break;
X			}
X		}
X
X		printf("%s",str);
X	} while ( !done );
X	printf("\n");
X
X	fclose( fin );
}
X
SHAR_EOF
  $shar_touch -am 0508190096 'icequote-1.1.1/icequote.c' &&
  chmod 0644 'icequote-1.1.1/icequote.c' ||
  $echo 'restore of' 'icequote-1.1.1/icequote.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'icequote-1.1.1/icequote.c:' 'MD5 check failed'
f3c93b2ef5f80e06c01a2b40df9d2028  icequote-1.1.1/icequote.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'icequote-1.1.1/icequote.c'`"
    test 4699 -eq "$shar_count" ||
    $echo 'icequote-1.1.1/icequote.c:' 'original size' '4699,' 'current size' "$shar_count!"
  fi
fi
# ============= icequote-1.1.1/Makefile ==============
if test -f 'icequote-1.1.1/Makefile' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'icequote-1.1.1/Makefile' '(file already exists)'
else
  $echo 'x -' extracting 'icequote-1.1.1/Makefile' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'icequote-1.1.1/Makefile' &&
# Makefile for the IceQuote package (with special Pratchett Quote File
# target).
#
# This was hacked together by Leo Breebaart, april 1993. Don't blame
# Ron Dippold for this!
#
X
ICE = iceidx icequote
X
CFLAGS = -O2
LDFLAGS = -s
X
all:	
X	@echo ""
X	@echo "Please use \"make TARGET\", where TARGET is one of:"
X	@echo "ice       - compile the icequote package"
X	@echo "tp        - same as \"make ice\", but also quotifies the PQF"
X	@echo "clean     - remove object files and PQF index file"
X	@echo "realclean - same as \"make clean\", but also removes executables, "
X	@echo ""
X
X
ice:	$(ICE)
X	
%:	%.c
X	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
X
tp:	ice pqf.idx 
X	@echo ""
X	@echo "The PQF has been Quotified and Ice-indexed."
X	@echo "Use \"icequote pqf.quo pqf.idx\" to get a Terry Pratchett Quote."
X	@echo "Have fun!"
X	@echo ""
X
pqf.idx:    pqf.quo
X	@echo "-- Ice-indexing the PQF quote file..."
X	@./iceidx pqf.quo pqf.idx
X
pqf.quo:
X	@echo ""
X	@echo "-- Converting the PQF to the an icequote source file"
X	@./quotify pqf pqf.quo
X
X
clean:	
X	rm -f *.o pqf.idx pqf.quo
X
realclean:  clean
X	rm -f icequote iceidx 
SHAR_EOF
  $shar_touch -am 0508190496 'icequote-1.1.1/Makefile' &&
  chmod 0644 'icequote-1.1.1/Makefile' ||
  $echo 'restore of' 'icequote-1.1.1/Makefile' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'icequote-1.1.1/Makefile:' 'MD5 check failed'
5858a620a6e81ea13adf8b1ef6797789  icequote-1.1.1/Makefile
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'icequote-1.1.1/Makefile'`"
    test 1098 -eq "$shar_count" ||
    $echo 'icequote-1.1.1/Makefile:' 'original size' '1098,' 'current size' "$shar_count!"
  fi
fi
# ============= icequote-1.1.1/quotify ==============
if test -f 'icequote-1.1.1/quotify' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'icequote-1.1.1/quotify' '(file already exists)'
else
  $echo 'x -' extracting 'icequote-1.1.1/quotify' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'icequote-1.1.1/quotify' &&
#! /bin/sh
#
# quotify: convert a quotes file from the format where two blank
# line separate individual quotes to the format where a '#' character
# separates the quotes.
#
# There's *got* to be an easier way to do this in Unix, but I'll be
# darned if I can find it. Even worse, I'm also pretty sure that
# the awk hack given below can be greatly simplified, but
# I seem to be suffering from brain damage right now and can't think
# of anything. Suggestions are most welcome.
#
# quotify written by Leo Breebaart, April 1993
X
case $# in
X  0|1)   echo 'Usage: quotify infile outfile' 1>&2; exit 2
esac
X
infile=$1;
outfile=$2;
X
if [ ! -f $infile ]
X  then
X    echo "" > pqf
X    echo Woops! Looks like you made a small mistake... >> pqf
X    echo "" >> pqf
X    echo In order to correctly \'quotify\' the Pratchett Quote File, you must >> pqf
X    echo first copy \(or link\) it to a file named \"pqf\" in the icequote source  >> pqf
X    echo directory. >> pqf
X    echo "" >> pqf
X    echo If you forget to do this, then a default \"pqf\" file containing this message >> pqf
X    echo will be created for you. Just delete it, install the true PQF, and try again.>> pqf
X    echo "" >> pqf
X    echo "" >> pqf
X    echo "" >> pqf
fi
X
cat $infile | awk '
BEGIN {
X         inquote = 1; 
X         firsttime = 1; 
X      }
NF==0 {  
X         if (inquote) 
X         { 
X            inquote = 0; 
X         } 
X         else 
X         { 
X            inquote = 1;
X    	    printf "%s", "#";
X         } 
X         next;
X      }
X
X      {
X         if (!inquote) 
X         {
X            inquote = 1;
X    	    printf "%s", "\n";
X         } 
X         if (firsttime)
X    	   firsttime = 0;
X         else
X           printf "%s", "\n";
X         printf "%s", $0;
X      }
'  > $outfile
X      
Xexit 0
SHAR_EOF
  $shar_touch -am 0508190496 'icequote-1.1.1/quotify' &&
  chmod 0755 'icequote-1.1.1/quotify' ||
  $echo 'restore of' 'icequote-1.1.1/quotify' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'icequote-1.1.1/quotify:' 'MD5 check failed'
efaf720d04c5bfdef56f6ca1c4ec118e  icequote-1.1.1/quotify
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'icequote-1.1.1/quotify'`"
    test 1767 -eq "$shar_count" ||
    $echo 'icequote-1.1.1/quotify:' 'original size' '1767,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh12174
exit 0
