$NetBSD: patch-ac,v 1.5 2000/02/05 06:56:16 wiz Exp $ --- name.c.orig Fri May 7 00:57:30 1999 +++ name.c Fri May 7 00:58:04 1999 @@ -25,6 +25,7 @@ #include "mkisofs.h" +#include #include extern int allow_leading_dots; @@ -58,6 +59,7 @@ const char * pnt; int priority = 32767; char * result; + char * copy; int seen_dot = 0; int seen_semic = 0; int tildes = 0; @@ -105,13 +107,17 @@ last_dot = strrchr (pnt,'.'); if( (last_dot != NULL) && ( (last_dot[1] == '~') - || (last_dot[1] == '\0') || (last_dot[1] == '\0')) ) { - c = last_dot; - *c = '\0'; + /* + * We gotta copy the string first, to work around its constness. + */ + copy = alloca (strlen(name) + 1); + memcpy (copy, name, strlen(name) + 1); + pnt = copy; + last_dot = strrchr (pnt,'.'); + *last_dot = '\0'; last_dot = strrchr (pnt,'.'); - *c = '.'; } while(*pnt)