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:
Chris Young 2010-07-09 19:55:13 +00:00
parent d6eb28d5de
commit 1510bbd3ad
5 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

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