Don't add a period to a log file name if it has no extension.

This commit is contained in:
Michael Alexsander Silva Dias 2018-05-29 22:36:50 -03:00
parent 28fa82c2de
commit cf9520ba2e

View file

@ -152,7 +152,10 @@ void RotatedFileLogger::rotate_file() {
OS::Time time = OS::get_singleton()->get_time(); OS::Time time = OS::get_singleton()->get_time();
sprintf(timestamp, "-%04d-%02d-%02d-%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec); sprintf(timestamp, "-%04d-%02d-%02d-%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
String backup_name = base_path.get_basename() + timestamp + "." + base_path.get_extension(); String backup_name = base_path.get_basename() + timestamp;
if (base_path.get_extension() != String()) {
backup_name += "." + base_path.get_extension();
}
DirAccess *da = DirAccess::open(base_path.get_base_dir()); DirAccess *da = DirAccess::open(base_path.get_base_dir());
if (da) { if (da) {