rem: while (*s && isspace(UCHAR(*s))) { ++s; } if (!strncasecmp(s, "href", 4)) { s += 4; while (*s && isspace(UCHAR(*s))) { ++s; } if (*s == '=') { ++s; while (*s && isspace(UCHAR(*s))) { ++s; } he = NULL; if (*s == '\'' || *s == '"') { he = strchr(s+1, *s); ++s; } if (he == NULL) { he = s; while (!isspace(UCHAR(*he))) { ++he; } } save = *he; *he = '\0'; Tcl_AppendElement(interp, s); *he = save; } }
add: while (*s) { if (!strncasecmp(s, "href", 4)) { s += 4; while (*s && isspace(UCHAR(*s))) { ++s; } if (*s == '=') { ++s; while (*s && isspace(UCHAR(*s))) { ++s; } he = NULL; if (*s == '\'' || *s == '"') { he = strchr(s+1, *s); ++s; } if (he == NULL) { he = s; while (!isspace(UCHAR(*he))) { ++he; } } save = *he; *he = '\0'; Tcl_AppendElement(interp, s); *he = save; break; } } if (*s == '\'' || *s == '\"') { while (*s && (*s != '\'' || *s != '\"')) { ++s; } continue; } ++s; }
context: NsTclHrefsCmd(ClientData dummy, Tcl_Interp *interp, int argc, char **argv){    char *p, *s, *e, *he, save;    if (argc != 2) {        Tcl_AppendResult(interp, "wrong # args: should be \"",                         argv[0], " html\"", (char *) NULL);        return TCL_ERROR;    }    p = argv[1];    while ((s = strchr(p, '<')) && (e = strchr(s, '>'))) {	++s;	*e = '\0';	while (*s && isspace(UCHAR(*s))) {	    ++s;	}	if ((*s == 'a' || *s == 'A') && isspace(UCHAR(s[1]))) {	    ++s;	    while (*s && isspace(UCHAR(*s))) {	    	++s;	    }	    if (!strncasecmp(s, "href", 4)) {		s += 4;		while (*s && isspace(UCHAR(*s))) {		    ++s;		}		if (*s == '=') {	    	    ++s;	    	    while (*s && isspace(UCHAR(*s))) {	    		++s;	    	    }		    he = NULL;		    if (*s == '\'' || *s == '"') {			he = strchr(s+1, *s);			++s;		    }		    if (he == NULL) {			he = s;			while (!isspace(UCHAR(*he))) {			    ++he;			}		    }		    save = *he;		    *he = '\0';		    Tcl_AppendElement(interp, s);		    *he = save;		}	    }	}	*e++ = '>';	p = e;    }    return TCL_OK;}