diff --git a/src/filegen.c b/src/filegen.c index 2f21c153..a1eef806 100644 --- a/src/filegen.c +++ b/src/filegen.c @@ -401,7 +401,8 @@ void file_rename(const char *old_filename, const unsigned char *buffer, const in case '\\': case ':': case '*': - *dst++ = '_'; + if(*(dst-1) != '_') + *dst++ = '_'; bad++; break; default: @@ -412,7 +413,8 @@ void file_rename(const char *old_filename, const unsigned char *buffer, const in } else { - *dst++ = '_'; + if(*(dst-1) != '_') + *dst++ = '_'; bad++; } break;