mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 14:59:47 +03:00
Check the last character for a path separator, rather than the NULL string termination.
svn path=/trunk/netsurf/; revision=10622
This commit is contained in:
parent
d6eb28d5de
commit
1510bbd3ad
@ -1209,7 +1209,7 @@ char *filename_from_path(char *path)
|
||||
|
||||
bool path_add_part(char *path, int length, char *newpart)
|
||||
{
|
||||
if(path[strlen(path)] != '/')
|
||||
if(path[strlen(path) - 1] != '/')
|
||||
strncat(path, "/", length);
|
||||
|
||||
strncat(path, newpart, length);
|
||||
|
@ -71,7 +71,7 @@ char *filename_from_path(char *path)
|
||||
|
||||
bool path_add_part(char *path, int length, char *newpart)
|
||||
{
|
||||
if(path[strlen(path)] != '/')
|
||||
if(path[strlen(path) - 1] != '/')
|
||||
strncat(path, "/", length);
|
||||
|
||||
strncat(path, newpart, length);
|
||||
|
@ -990,7 +990,7 @@ char *filename_from_path(char *path)
|
||||
|
||||
bool path_add_part(char *path, int length, char *newpart)
|
||||
{
|
||||
if(path[strlen(path)] != '/')
|
||||
if(path[strlen(path) - 1] != '/')
|
||||
strncat(path, "/", length);
|
||||
|
||||
strncat(path, newpart, length);
|
||||
|
@ -2490,7 +2490,7 @@ char *filename_from_path(char *path)
|
||||
|
||||
bool path_add_part(char *path, int length, char *newpart)
|
||||
{
|
||||
if(path[strlen(path)] != '.')
|
||||
if(path[strlen(path) - 1] != '.')
|
||||
strncat(path, ".", length);
|
||||
|
||||
strncat(path, newpart, length);
|
||||
|
@ -77,7 +77,7 @@ char *filename_from_path(char *path)
|
||||
|
||||
bool path_add_part(char *path, int length, char *newpart)
|
||||
{
|
||||
if(path[strlen(path)] != '\\')
|
||||
if(path[strlen(path) - 1] != '\\')
|
||||
strncat(path, "\\", length);
|
||||
|
||||
strncat(path, newpart, length);
|
||||
|
Loading…
Reference in New Issue
Block a user