From: ceriel Date: Thu, 11 Dec 1986 17:04:40 +0000 (+0000) Subject: Improved testing for 0-strings in the routine "mycat". X-Git-Tag: release-5-5~5094 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9e6fe01229e0ef4c0de5746f988f6a3c79b2f792;p=ack.git Improved testing for 0-strings in the routine "mycat". --- diff --git a/mach/proto/ncg/compute.c b/mach/proto/ncg/compute.c index c86e073d3..d023fd892 100644 --- a/mach/proto/ncg/compute.c +++ b/mach/proto/ncg/compute.c @@ -86,8 +86,8 @@ string salloc(),strcpy(),strcat(); string mycat(s1,s2) register string s1,s2; { register string s; - if (s1==0) return(s2); - if (s2==0) return(s1); + if (s1==0 || *s1=='\0') return(s2); + if (s2==0 || *s2=='\0') return(s1); s=salloc(strlen(s1)+strlen(s2)+1); strcpy(s,s1); strcat(s,"+");