Subject: fix for empty quoted args in make(1)
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Christos Zoulas <christos@deshaw.com>
List: current-users
Date: 05/17/1994 09:45:22
Fix for quoted args in make:

Repeat by:

% cat t1
#!/bin/sh
echo $#
for i 
do
	echo ">$i<"
done
% cat Makefile
foo:
	t1 "''" '"' "'" '""' '' 'a b' "b c"
% make
Note that the argument before 'a b' is missing.

christos

*** str.c.orig	Thu Mar 24 05:59:35 1994
--- str.c	Tue May 17 09:37:11 1994
***************
*** 139,146 ****
  					inquote = '\0';
  				else
  					break;
! 			else
  				inquote = (char) ch;
  			continue;
  		case ' ':
  		case '\t':
--- 138,151 ----
  					inquote = '\0';
  				else
  					break;
! 			else {
  				inquote = (char) ch;
+ 				/* Don't miss "" or '' */
+ 				if (start == NULL && p[1] == inquote) {
+ 					start = t + 1;
+ 					break;
+ 				}
+ 			}
  			continue;
  		case ' ':
  		case '\t':

------------------------------------------------------------------------------