Commits (1)
  • Rob Swindell's avatar
    De-dupe random menu filenames by truncating at first dot, rather than last. · 479bd24c
    Rob Swindell authored
    Fix for one of the problems described in issue #380."random*"); would display column-width-specific files (e.g.
    random.132col.msg) even when they weren't appropriate for the current
    user terminal width.
    This is fixed by truncating the filenames matching the requested pattern at
    their first-dot rather than the last.
    The downside is, you can't have a set of random.#.* files, where # is the
    unique part of the filename and * is the file-type extension. Just use
    the naming pattern "random-#.*" instead (or something similar) instead.
......@@ -325,7 +325,7 @@ bool sbbs_t::random_menu(const char *name, long mode, JSObject* obj)
return false;
for(size_t i = 0; i < g.gl_pathc; i++) {
char* ext = getfext(g.gl_pathv[i]);
char* ext = strchr(g.gl_pathv[i], '.'); // intentionally not using getfext() - issue #380
if(ext == NULL)
*ext = 0;