Index: htmlurl.c
===================================================================
RCS file: /proj/rd/cvsroot/saods9/htmlwidget/src/htmlurl.c,v
retrieving revision 1.1
retrieving revision 1.4
diff -r1.1 -r1.4
1c1
< static char const rcsid[] = "@(#) $Id: htmlurl.c,v 1.2 2014/08/11 20:46:45 joye Exp $";
---
> static char const rcsid[] = "@(#) $Id: htmlurl.c,v 1.2 2014/08/11 20:46:45 joye Exp $";
84a85,86
>   if(!n)
>     return NULL;
119c121,123
<   n = ComponentLength(zUri, "", "?# ");
---
>   /* allow spaces in path */
>   /* n = ComponentLength(zUri, "", "?# ");*/
>   n = ComponentLength(zUri, "", "?#");
315,316c319,326
<               strcpy(&zBuf[i+1], &zBuf[i+3]);
<               i--;
---
> 	      // strcpy into same buf is undefined
> 	      // strcpy(&zBuf[i+1], &zBuf[i+3]);
> 	      int ll = strlen(zBuf+i+3)+1;
> 	      char* tmp = malloc(ll);
> 	      strncpy(tmp,zBuf+i+3,ll);
> 	      strcpy(zBuf+i+1, tmp);
> 	      free(tmp);
> 	      i--;
327c337,343
<                 strcpy(&zBuf[j+1], &zBuf[i+4]);
---
> 		// strcpy into same buf is undefined
> 		// strcpy(&zBuf[j+1], &zBuf[i+4]);
> 		int ll = strlen(zBuf+i+4)+1;
> 		char* tmp = malloc(ll);
> 		strncpy(tmp,zBuf+i+4,ll);
> 		strcpy(zBuf+j+1, tmp);
> 		free(tmp);
335a352,361
> 	  /* look for /../ at begining */
> 	  if (!strncmp(zBuf,"/../",4)) {
> 	    // strcpy into same buf is undefined
> 	    // strcpy(zBuf,zBuf+3);
> 	    int ll = strlen(zBuf+3)+1;
> 	    char* tmp = malloc(ll);
> 	    strncpy(tmp,zBuf+3,ll);
> 	    strcpy(zBuf, tmp);
> 	    free(tmp);
> 	  }
