mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 02:46:34 +08:00
Fix comparison that's always true
... because base_dir[0] and dest_dir[0] are *signed* chars. (Backport from FLTK 1.5)
This commit is contained in:
@@ -612,8 +612,8 @@ Fl_WinAPI_System_Driver::filename_relative(char *to, // O - Relative filename
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if there is a drive letter, make sure both paths use the same drive
|
// if there is a drive letter, make sure both paths use the same drive
|
||||||
if ( base_dir[0] < 128 && isalpha(base_dir[0]) && base_dir[1] == ':'
|
if ( (unsigned)base_dir[0] < 128 && isalpha(base_dir[0]) && base_dir[1] == ':'
|
||||||
&& dest_dir[0] < 128 && isalpha(dest_dir[0]) && dest_dir[1] == ':') {
|
&& (unsigned)dest_dir[0] < 128 && isalpha(dest_dir[0]) && dest_dir[1] == ':') {
|
||||||
if (tolower(base_dir[0]) != tolower(dest_dir[0])) {
|
if (tolower(base_dir[0]) != tolower(dest_dir[0])) {
|
||||||
strlcpy(to, dest_dir, tolen);
|
strlcpy(to, dest_dir, tolen);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user