Previous 15994 Revisions Next

r2520 Friday 2nd May, 2008 at 02:13:06 UTC by Nathan Woods
Fixed bug in file selector that could cause paths to contain extraneous
separators. (bug #1595)
[docs]messnew.txt
[src/mess]filemngr.c

src/mess/filemngr.c
r2519r2520
412412   free(tmp_types);
413413}
414414
415
416
417static int string_ends_with(const char *str, const char *target)
418{
419   size_t str_length = strlen(str);
420   size_t target_length = strlen(target);
421
422   return (str_length >= target_length)
423      && !strcmp(&str[str_length - target_length], target);
424
425}
426
427
428
415429#define UI_SHIFT_PRESSED      (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))
416430#define UI_CONTROL_PRESSED      (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL))
417431/* and mask to get bits */
r2519r2520
567581               }
568582               else
569583               {
570                  strncpyz(entered_filename, curdir, strlen(curdir)+1);
571                  strncatz(entered_filename, PATH_SEPARATOR, sizeof(entered_filename) / sizeof(entered_filename[0]));
572                  strncatz(entered_filename, fs_item[sel].text, sizeof(entered_filename) / sizeof(entered_filename[0]));
584                  snprintf(entered_filename, ARRAY_LENGTH(entered_filename), "%s%s%s",
585                     curdir,
586                     string_ends_with(curdir, PATH_SEPARATOR) ? "" : PATH_SEPARATOR,
587                     fs_item[sel].text);
573588               }
574589
575590               fs_free();
docs/messnew.txt
r2519r2520
7070
7171User Interface Changes:
7272-----------------------
73- Fixed bug in file selector that could cause paths to contain extraneous
74  separators.  (bug #1595) [Nate Woods]
75
7376- [Windows] Fixed "Configure..." dialog problem when customizing certain
7477  system's controllers.  (bugs #1570, #1573) [Nate Woods]
7578

Previous 15994 Revisions Next


© 1998-2018 The MESS Team