Fix filebackup when saving.

It was the wrong filename that was backuped when using "Save As".
Now it is the filename selected.
This commit is contained in:
Thomas Bernard
2018-03-26 10:48:24 +02:00
parent 187c7d53e3
commit c8bc04e413
4 changed files with 47 additions and 40 deletions

View File

@@ -292,6 +292,28 @@ void Append_path(char *path, const char *filename, char *reverse_path)
}
}
int Position_last_dot(const char * fname)
{
int pos_last_dot = -1;
int c = 0;
for (c = 0; fname[c] != '\0'; c++)
if (fname[c] == '.')
pos_last_dot = c;
return pos_last_dot;
}
int Position_last_dot_unicode(const word * fname)
{
int pos_last_dot = -1;
int c = 0;
for (c = 0; fname[c] != '\0'; c++)
if (fname[c] == '.')
pos_last_dot = c;
return pos_last_dot;
}
int File_exists(const char * fname)
// Détermine si un file passé en paramètre existe ou non dans le
// répertoire courant.