X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=3ff1f8aa9c269d18e84b4bcb8ecf9d806287acd3;hb=1ae81bd84cbf998cdd03a118e881668ce5a23cf1;hp=3e7719e1da6a32292a6a1339784f5ed27024150e;hpb=0c2353284cebd88f2d68cafc2acced0285a00b53;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 3e7719e1..3ff1f8aa 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -682,10 +682,16 @@ char *getBasePath(char *filename) char *basepath = getStringCopy(filename); char *last_separator = getLastPathSeparatorPtr(basepath); - if (last_separator != NULL) - *last_separator = '\0'; /* separator found: strip basename */ - else - basepath = "."; /* no separator found: use current path */ + /* if no separator was found, use current directory */ + if (last_separator == NULL) + { + free(basepath); + + return getStringCopy("."); + } + + /* separator found: strip basename */ + *last_separator = '\0'; return basepath; } @@ -2922,6 +2928,9 @@ int get_parameter_value(char *value_raw, char *suffix, int type) if (string_has_parameter(value, "inner_corners")) result |= STYLE_INNER_CORNERS; + + if (string_has_parameter(value, "reverse")) + result |= STYLE_REVERSE; } else if (strEqual(suffix, ".fade_mode")) {