--- name.c.orig Thu Apr 10 04:41:48 1997 +++ name.c Wed Oct 29 12:11:01 1997 @@ -58,6 +58,7 @@ const char * pnt; int priority = 32767; char * result; + char * copy; int seen_dot = 0; int seen_semic = 0; int tildes = 0; @@ -105,13 +106,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)