[comp.sources.d] getmaps.c -- minor problem with jul/aug maps

joe@auspyr.UUCP (Joe Angelo) (08/03/87)

noticed minor bug with posted getmaps.c program; backslash can be part
of compare string from here-document terminator. in string "cat <<\SHAR_EOF",
"\SHAR_EOF" is searched for instead of "SHAR_EOF, which is wrong.

Below diff-c corrects the problem...

Please excuse me if someone else already corrected this.

*** getmaps.c	Mon Aug  3 09:26:12 1987
--- getmaps.c.orig	Mon Aug  3 09:28:42 1987
***************
*** 282,288
  	while (*ptr != NULL) {
  		if (*ptr == '\\' && (*(ptr + 1) == '\'' || *(ptr + 1) == '"'))
  			ptr += 2;
! 		else if (*ptr == '\'' || *ptr == '"' || *ptr == '\\') {
  			t1ptr = ptr;
  			t2ptr = ptr + 1;
  			while ((*t1ptr++ = *t2ptr++) != NULL)

--- 282,288 -----
  	while (*ptr != NULL) {
  		if (*ptr == '\\' && (*(ptr + 1) == '\'' || *(ptr + 1) == '"'))
  			ptr += 2;
! 		else if (*ptr == '\'' || *ptr == '"' ) {
  			t1ptr = ptr;
  			t2ptr = ptr + 1;
  			while ((*t1ptr++ = *t2ptr++) != NULL)
-- 
"I'm trying     Joe Angelo, Sr. Sys. Engineer @ Austec, Inc., San Jose, CA.
 to think,      ARPA: auspyr!joe@lll-tis[-b].arpa     PHONE: [408] 279-5533
 but nothin'    UUCP: {sdencore,cbosgd,ptsfa,dana}!aussjo!joe
 happens!"      UUCP: {amdahl,lll-tis,imagen,necntc,dlb,sci,altnet}!auspyr!joe