diff -rc ./Vend/Glimpse.pm /usr/local/lib/minivend/Vend/Glimpse.pm
*** ./Vend/Glimpse.pm	Mon Jan  6 20:40:55 1997
--- /usr/local/lib/minivend/Vend/Glimpse.pm	Sat Jan 18 10:04:01 1997
***************
*** 1,6 ****
  # Vend/Glimpse.pm:  Search indexes with Glimpse
  #
! # $Id: Glimpse.pm,v 2.5 1996/12/16 08:53:44 mike Exp $
  #
  # ADAPTED FOR USE WITH MINIVEND from Search::Glimpse
  #
--- 1,6 ----
  # Vend/Glimpse.pm:  Search indexes with Glimpse
  #
! # $Id: Glimpse.pm,v 2.6 1997/01/18 15:03:38 mike Exp mike $
  #
  # ADAPTED FOR USE WITH MINIVEND from Search::Glimpse
  #
***************
*** 28,34 ****
  require Vend::Search;
  @ISA = qw(Vend::Search);
  
! $VERSION = substr(q$Revision: 2.5 $, 10);
  use Text::ParseWords;
  use strict;
  
--- 28,34 ----
  require Vend::Search;
  @ISA = qw(Vend::Search);
  
! $VERSION = substr(q$Revision: 2.6 $, 10);
  use Text::ParseWords;
  use strict;
  
***************
*** 170,176 ****
  		if defined $g->{search_file} && $g->{search_file};
  
  	push(@cmd, '-w') unless $g->{substring_match};
! 	push(@cmd, '-l') if $g->{return_file_name};
  	
  	# Calls and returns sort string based on
  	# sort_field and sort_options settings
--- 170,176 ----
  		if defined $g->{search_file} && $g->{search_file};
  
  	push(@cmd, '-w') unless $g->{substring_match};
! 	push(@cmd, '-O -U') if $g->{return_file_name};
  	
  	# Calls and returns sort string based on
  	# sort_field and sort_options settings
diff -rc ./Vend/Interpolate.pm /usr/local/lib/minivend/Vend/Interpolate.pm
*** ./Vend/Interpolate.pm	Mon Jan  6 20:40:55 1997
--- /usr/local/lib/minivend/Vend/Interpolate.pm	Sat Jan 18 10:04:46 1997
***************
*** 1,6 ****
  # Interpolate.pm - Interpret MiniVend tags
  # 
! # $Id: Interpolate.pm,v 2.20 1997/01/07 01:33:26 mike Exp $
  #
  # Copyright 1996 by Michael J. Heins <mikeh@iac.net>
  #
--- 1,6 ----
  # Interpolate.pm - Interpret MiniVend tags
  # 
! # $Id: Interpolate.pm,v 2.21 1997/01/18 15:03:38 mike Exp mike $
  #
  # Copyright 1996 by Michael J. Heins <mikeh@iac.net>
  #
***************
*** 22,28 ****
  require Exporter;
  @ISA = qw(Exporter);
  
! $VERSION = substr(q$Revision: 2.20 $, 10);
  
  @EXPORT = qw (
  
--- 22,28 ----
  require Exporter;
  @ISA = qw(Exporter);
  
! $VERSION = substr(q$Revision: 2.21 $, 10);
  
  @EXPORT = qw (
  
***************
*** 253,258 ****
--- 253,261 ----
  		return (! defined $Vend::Session->{$field}
  			? '' :  $Vend::Session->{$field} );
  	}
+ 	elsif($selector eq 'sessionid') {
+ 		return $Vend::SessionID;
+ 	}
  	elsif($selector eq 'config') {
  		no strict 'refs';
  		return (! defined $Vend::Cfg->{$field}
***************
*** 605,616 ****
  		}
  
  		if (defined $Vend::Session->{scratch}->{$name}) {
! 			my $sub = $Vend::Session->{scratch}->{$name};
! 			$result = $safe->reval( '@_ = ' . $body . ';' . $code . $sub);
  		}
  		elsif (defined $Vend::Cfg->{Sub}->{$name}) {
! 			my $sub = $Vend::Cfg->{Sub}->{$name};
! 			$result = $safe->reval( '@_ = ' . $body . ';' . $code . $sub);
  		}
  		elsif (defined $Global::GlobalSub->{$name}) {
  			$result = &{$Global::GlobalSub->{$name}};
--- 608,619 ----
  		}
  
  		if (defined $Vend::Session->{scratch}->{$name}) {
! 			$result = $safe->reval( '@_ = ' . $body . ';' . $code .
! 						$Vend::Session->{scratch}->{$name});
  		}
  		elsif (defined $Vend::Cfg->{Sub}->{$name}) {
! 			$result = $safe->reval( '@_ = ' . $body . ';' . $code .
! 						$Vend::Cfg->{Sub}->{$name} );
  		}
  		elsif (defined $Global::GlobalSub->{$name}) {
  			$result = &{$Global::GlobalSub->{$name}};
diff -rc ./Vend/Scan.pm /usr/local/lib/minivend/Vend/Scan.pm
*** ./Vend/Scan.pm	Mon Jan  6 20:40:55 1997
--- /usr/local/lib/minivend/Vend/Scan.pm	Sat Jan 18 10:05:17 1997
***************
*** 1,6 ****
  # Vend/Scan.pm:  Prepare searches for MiniVend
  #
! # $Id: Scan.pm,v 2.8 1997/01/07 01:16:56 mike Exp $
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
--- 1,6 ----
  # Vend/Scan.pm:  Prepare searches for MiniVend
  #
! # $Id: Scan.pm,v 2.9 1997/01/18 15:03:38 mike Exp mike $
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
***************
*** 26,32 ****
  			perform_search
  			);
  
! $VERSION = substr(q$Revision: 2.8 $, 10);
  
  use strict;
  use Vend::Util;
--- 26,32 ----
  			perform_search
  			);
  
! $VERSION = substr(q$Revision: 2.9 $, 10);
  
  use strict;
  use Vend::Util;
***************
*** 106,111 ****
--- 106,112 ----
  					mv_record_delim		record_delim
  					mv_return_delim		return_delim
  					mv_return_fields	return_fields
+ 					mv_return_file_name	return_file_name
  					mv_search_field		search_field
  					mv_search_file		search_file
  					mv_search_page		search_page
***************
*** 191,196 ****
--- 192,198 ----
  	sort_field			=>	\&_column,
  	sort_option			=>	\&_array,
  	sort_crippled		=>	\&_yes,
+ 	sort_command		=>	\&_command,
  	search_file         => 	\&_scalar_or_array,
  	field_names         =>	\&_array,
  	spelling_errors     => 	sub { my $n = int($_[1]); $n < 8 ? $n : 1; },
***************
*** 493,498 ****
--- 495,506 ----
  		$i++;
  	}
  	return undef;
+ }
+ 
+ sub _command {
+     return undef unless defined $_[1];
+     return undef unless $_[1] =~ m{^\S+$};
+     return $_[1];
  }
  
  sub _array {
diff -rc ./Vend/Server.pm /usr/local/lib/minivend/Vend/Server.pm
*** ./Vend/Server.pm	Mon Jan  6 20:40:55 1997
--- /usr/local/lib/minivend/Vend/Server.pm	Sat Jan 18 10:05:34 1997
***************
*** 1,6 ****
  # Server.pm:  listen for cgi requests as a background server
  #
! # $Id: Server.pm,v 1.8 1997/01/07 01:16:56 mike Exp $
  
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
  #
--- 1,6 ----
  # Server.pm:  listen for cgi requests as a background server
  #
! # $Id: Server.pm,v 1.9 1997/01/18 15:03:38 mike Exp mike $
  
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
  #
***************
*** 680,685 ****
--- 680,692 ----
  					$next = server_inet($debug);
  				}
  				unlockfile(\*Vend::Server::Pid);
+ 	opendir(CONFDIR, $Global::ConfDir) 
+ 		or die "Couldn't open directory $Global::ConfDir: $!\n";
+ 	my @running = grep /^mvrunning/, readdir CONFDIR;
+ 	for(@running) {
+ 		unlink "$Global::ConfDir/$_" or die
+ 			"Couldn't unlink status file $Global::ConfDir/$_: $!\n";
+ 	}
  				unlink $pidfile;
                  exit 0;
              }
diff -rc ./Vend/Table/DB_File.pm /usr/local/lib/minivend/Vend/Table/DB_File.pm
*** ./Vend/Table/DB_File.pm	Mon Jan  6 20:40:56 1997
--- /usr/local/lib/minivend/Vend/Table/DB_File.pm	Sat Jan 18 10:06:19 1997
***************
*** 1,6 ****
  # Table/DB_File.pm: access a table stored in a DB file hash
  #
! # $Id: DB_File.pm,v 1.2 1996/08/22 17:35:08 mike Exp $
  #
  
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
--- 1,6 ----
  # Table/DB_File.pm: access a table stored in a DB file hash
  #
! # $Id: DB_File.pm,v 1.3 1997/01/18 15:06:03 mike Exp mike $
  #
  
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
***************
*** 8,13 ****
--- 8,16 ----
  # Modified 1996 by Mike Heins <mikeh@iac.net>
  #
  # $Log: DB_File.pm,v $
+ # Revision 1.3  1997/01/18 15:06:03  mike
+ # Fixed % bug -- wouldn't display
+ #
  # Revision 1.2  1996/08/22 17:35:08  mike
  # Save solid snapshot of multiple catalog Vend
  #
***************
*** 33,39 ****
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  package Vend::Table::DB_File;
! $VERSION = substr(q$Revision: 1.2 $, 10);
  use Carp;
  use strict;
  use Fcntl;
--- 36,42 ----
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  package Vend::Table::DB_File;
! $VERSION = substr(q$Revision: 1.3 $, 10);
  use Carp;
  use strict;
  use Fcntl;
***************
*** 43,49 ****
  {
      my $i;
      foreach $i (0..255) {
!         $Hex_string[$i] = sprintf("%02X", $i);
      }
  }
  
--- 46,52 ----
  {
      my $i;
      foreach $i (0..255) {
!         $Hex_string[$i] = sprintf("%%%02X", $i);
      }
  }
  
diff -rc ./Vend/Table/GDBM.pm /usr/local/lib/minivend/Vend/Table/GDBM.pm
*** ./Vend/Table/GDBM.pm	Mon Jan  6 20:40:56 1997
--- /usr/local/lib/minivend/Vend/Table/GDBM.pm	Sat Jan 18 10:06:29 1997
***************
*** 1,6 ****
  # Table/GDBM.pm: access a table stored in a GDBM file
  #
! # $Id: GDBM.pm,v 1.4 1997/01/07 01:34:10 mike Exp $
  #
  
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
--- 1,6 ----
  # Table/GDBM.pm: access a table stored in a GDBM file
  #
! # $Id: GDBM.pm,v 1.5 1997/01/18 15:06:03 mike Exp mike $
  #
  
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
***************
*** 20,26 ****
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  package Vend::Table::GDBM;
! $VERSION = substr(q$Revision: 1.4 $, 10);
  use Carp;
  use strict;
  use GDBM_File;
--- 20,26 ----
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  package Vend::Table::GDBM;
! $VERSION = substr(q$Revision: 1.5 $, 10);
  use Carp;
  use strict;
  use GDBM_File;
***************
*** 29,35 ****
  {
      my $i;
      foreach $i (0..255) {
!         $Hex_string[$i] = sprintf("%02X", $i);
      }
  }
  
--- 29,35 ----
  {
      my $i;
      foreach $i (0..255) {
!         $Hex_string[$i] = sprintf("%%%02X", $i);
      }
  }
  
diff -rc ./Vend/Table/Msql.pm /usr/local/lib/minivend/Vend/Table/Msql.pm
*** ./Vend/Table/Msql.pm	Mon Jan  6 20:40:56 1997
--- /usr/local/lib/minivend/Vend/Table/Msql.pm	Sat Jan 18 10:06:40 1997
***************
*** 1,6 ****
  # Table/Msql.pm: access a table stored in an Msql Database
  #
! # $Id: Msql.pm,v 1.4 1996/12/16 08:53:44 mike Exp $
  #
  
  # Basic schema
--- 1,6 ----
  # Table/Msql.pm: access a table stored in an Msql Database
  #
! # $Id: Msql.pm,v 1.5 1997/01/18 15:06:03 mike Exp mike $
  #
  
  # Basic schema
***************
*** 24,30 ****
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  package Vend::Table::Msql;
! $VERSION = substr(q$Revision: 1.4 $, 10);
  
  use Carp;
  use strict;
--- 24,30 ----
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  package Vend::Table::Msql;
! $VERSION = substr(q$Revision: 1.5 $, 10);
  
  use Carp;
  use strict;
***************
*** 34,40 ****
  {
      my $i;
      foreach $i (0..255) {
!         $Hex_string[$i] = sprintf("%02X", $i);
      }
  }
  
--- 34,40 ----
  {
      my $i;
      foreach $i (0..255) {
!         $Hex_string[$i] = sprintf("%%%02X", $i);
      }
  }
  
diff -rc ./Vend/Util.pm /usr/local/lib/minivend/Vend/Util.pm
*** ./Vend/Util.pm	Mon Jan  6 20:40:56 1997
--- /usr/local/lib/minivend/Vend/Util.pm	Sat Jan 18 10:05:51 1997
***************
*** 1,4 ****
! # $Id: Util.pm,v 2.9 1996/12/16 08:53:44 mike Exp $
  
  package Vend::Util;
  require Exporter;
--- 1,4 ----
! # $Id: Util.pm,v 2.10 1997/01/18 15:03:38 mike Exp mike $
  
  package Vend::Util;
  require Exporter;
***************
*** 561,567 ****
  
      $ok = 0;
      SEND: {
! 		open(Vend::MAIL,"|$Vend::Cfg->{'SendMailProgram'} $to") or last SEND;
  		print Vend::MAIL "To: $to\n", $reply, "Subject: $subject\n\n", $body
  	    	or last SEND;
  		close Vend::MAIL or last SEND;
--- 561,567 ----
  
      $ok = 0;
      SEND: {
! 		open(Vend::MAIL,"|$Vend::Cfg->{'SendMailProgram'} -t") or last SEND;
  		print Vend::MAIL "To: $to\n", $reply, "Subject: $subject\n\n", $body
  	    	or last SEND;
  		close Vend::MAIL or last SEND;
diff -rc ./bin/dump /usr/local/lib/minivend/bin/dump
*** ./bin/dump	Mon Jan  6 20:41:05 1997
--- /usr/local/lib/minivend/bin/dump	Sat Jan 18 10:07:09 1997
***************
*** 2,8 ****
  #
  # MiniVend session dumper
  #
! # $Id: dump,v 2.3 1997/01/07 01:40:44 mike Exp mike $
  #
  # This program is largely based on Vend 0.2
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
--- 2,8 ----
  #
  # MiniVend session dumper
  #
! # $Id: dump,v 2.3 1997/01/07 01:40:44 mike Exp $
  #
  # This program is largely based on Vend 0.2
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
diff -rc ./bin/expire /usr/local/lib/minivend/bin/expire
*** ./bin/expire	Mon Jan  6 20:41:07 1997
--- /usr/local/lib/minivend/bin/expire	Sat Jan 18 10:07:09 1997
***************
*** 2,8 ****
  #
  # MiniVend session expiration
  #
! # $Id: expire,v 2.3 1997/01/07 01:40:44 mike Exp mike $
  #
  # This program is largely based on Vend 0.2
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
--- 2,8 ----
  #
  # MiniVend session expiration
  #
! # $Id: expire,v 2.3 1997/01/07 01:40:44 mike Exp $
  #
  # This program is largely based on Vend 0.2
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
diff -rc ./bin/offline /usr/local/lib/minivend/bin/offline
*** ./bin/offline	Mon Jan  6 20:41:14 1997
--- /usr/local/lib/minivend/bin/offline	Sat Jan 18 10:07:10 1997
***************
*** 2,8 ****
  #
  # offline - MiniVend database builder and indexer
  #
! # $Id: offline,v 1.4 1997/01/07 01:40:44 mike Exp mike $
  #
  # This program is largely based on Vend 0.2
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
--- 2,8 ----
  #
  # offline - MiniVend database builder and indexer
  #
! # $Id: offline,v 1.4 1997/01/07 01:40:44 mike Exp $
  #
  # This program is largely based on Vend 0.2
  # Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
diff -rc ./bin/stop /usr/local/lib/minivend/bin/stop
*** ./bin/stop	Mon Jan  6 17:18:30 1997
--- /usr/local/lib/minivend/bin/stop	Wed Jan  8 05:51:11 1997
***************
*** 20,26 ****
  usage: stop [-f]
  
  Stops all MiniVend daemons. The -f flag forces unlink of
! all PID files and sockets.
  EOF
  	$force = 1;
  }
--- 20,26 ----
  usage: stop [-f]
  
  Stops all MiniVend daemons. The -f flag forces unlink of
! all PID files, status files, and sockets.
  EOF
  	$force = 1;
  }
***************
*** 100,105 ****
--- 100,111 ----
  	}
  	sleep 3;
  	rewinddir CONFDIR;
+ }
+ 
+ if($force) {
+ 	rewinddir CONFDIR;
+ 	my(@running) = grep /^mvrunning/, readdir CONFDIR;
+ 	unlink @running;
  }
  
  closedir CONFDIR;
diff -rc ./sample/products/pricing.asc /usr/local/lib/minivend/sample/products/pricing.asc
*** ./sample/products/pricing.asc	Mon Jan  6 07:16:05 1997
--- /usr/local/lib/minivend/sample/products/pricing.asc	Fri Jan 10 07:39:55 1997
***************
*** 1,4 ****
! 00-0011	1000   500 250
  00-0011a	50 45 40 35 30
  19-202	400 200 100 50 20
  00-341	400 200 100 50 20
--- 1,5 ----
! sku	price
! 00-0011	1000 500 250
  00-0011a	50 45 40 35 30
  19-202	400 200 100 50 20
  00-341	400 200 100 50 20
***************
*** 6,8 ****
--- 7,10 ----
  00-343	400 200 100 50 20
  21-221	400 200 100 50 20
  34-101	400 200 100 50 20
+ 99-102	9 8 7 7 6
diff -rc ./src/tlink.pl /usr/local/lib/minivend/src/tlink.pl
*** ./src/tlink.pl	Mon Jan  6 20:42:11 1997
--- /usr/local/lib/minivend/src/tlink.pl	Sat Jan 18 10:07:46 1997
***************
*** 1,7 ****
  #!/usr/local/bin/perl -wT
  # tlink.pl: runs as a cgi program and passes request to Vend server
  #
! #   $Id: tlink.pl,v 1.2 1997/01/07 01:40:44 mike Exp mike $
  #
  #   Copyright 1996 by by Mike Heins <mikeh@iac.net>
  #
--- 1,7 ----
  #!/usr/local/bin/perl -wT
  # tlink.pl: runs as a cgi program and passes request to Vend server
  #
! #   $Id: tlink.pl,v 1.3 1997/01/18 15:07:38 mike Exp mike $
  #
  #   Copyright 1996 by by Mike Heins <mikeh@iac.net>
  #
***************
*** 78,93 ****
  sub get_entity {
  
    return '' unless defined $ENV{CONTENT_LENGTH};
!   my $len = $ENV{CONTENT_LENGTH};
    return '' unless $len;
  
  
!   my $buf = '';
!   $Entity = read(STDIN, $buf, $len);
  
  }
  
  
  sub send_arguments {
  
  	my $count = @ARGV;
--- 78,99 ----
  sub get_entity {
  
    return '' unless defined $ENV{CONTENT_LENGTH};
!   my $len = $ENV{CONTENT_LENGTH} || 0;
    return '' unless $len;
  
+   my $check;
  
!   $check = read(STDIN, $Entity, $len);
! 
!   die_page("Entity wrong length")
!       unless $check == $len;
! 
!   $Entity;
  
  }
  
  
+ 
  sub send_arguments {
  
  	my $count = @ARGV;
***************
*** 115,121 ****
  sub send_entity {
  	return '' unless defined $ENV{CONTENT_LENGTH};
  	my $len = $ENV{CONTENT_LENGTH};
- 	warn "got a length of $len\n";
  	return '' unless $len > 0;
  
  	my $val = "entity\n";
--- 121,126 ----
diff -rc ./src/vlink.pl /usr/local/lib/minivend/src/vlink.pl
*** ./src/vlink.pl	Mon Jan  6 20:42:12 1997
--- /usr/local/lib/minivend/src/vlink.pl	Sat Jan 18 10:07:49 1997
***************
*** 1,7 ****
  #!/usr/local/bin/perl -wT
  # vlink.pl: runs as a cgi program and passes request to Vend server
  #           via TCP UNIX-domain socket
! #   $Id: vlink.pl,v 1.1 1996/12/16 05:57:23 mike Exp $
  #
  #   Copyright 1996 by by Mike Heins <mikeh@iac.net>
  #
--- 1,7 ----
  #!/usr/local/bin/perl -wT
  # vlink.pl: runs as a cgi program and passes request to Vend server
  #           via TCP UNIX-domain socket
! #   $Id: vlink.pl,v 1.2 1997/01/18 15:07:38 mike Exp mike $
  #
  #   Copyright 1996 by by Mike Heins <mikeh@iac.net>
  #
***************
*** 77,88 ****
  sub get_entity {
  
    return '' unless defined $ENV{CONTENT_LENGTH};
!   my $len = $ENV{CONTENT_LENGTH};
    return '' unless $len;
  
  
!   my $buf = '';
!   $Entity = read(SOCK, $buf, $len);
  
  }
  
--- 77,93 ----
  sub get_entity {
  
    return '' unless defined $ENV{CONTENT_LENGTH};
!   my $len = $ENV{CONTENT_LENGTH} || 0;
    return '' unless $len;
  
+   my $check;
  
!   $check = read(STDIN, $Entity, $len);
! 
!   die_page("Entity wrong length")
! 	  unless $check == $len;
! 
!   $Entity;
  
  }
  
***************
*** 114,120 ****
  sub send_entity {
  	return '' unless defined $ENV{CONTENT_LENGTH};
  	my $len = $ENV{CONTENT_LENGTH};
! 	warn "got a length of $len\n";
  	return '' unless $len > 0;
  
  	my $val = "entity\n";
--- 119,125 ----
  sub send_entity {
  	return '' unless defined $ENV{CONTENT_LENGTH};
  	my $len = $ENV{CONTENT_LENGTH};
! 
  	return '' unless $len > 0;
  
  	my $val = "entity\n";
