PhotoRec: avoid successive '_' chars in filenames

This commit is contained in:
Christophe Grenier 2012-02-11 19:25:53 +01:00
parent 1121817a82
commit 8b12fd3d04

View file

@ -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;