From: Ralph Corderoy Date: Sun, 10 Sep 2017 12:38:18 +0000 (+0100) Subject: get_file_info(): Don't return filename from quote onwards on error. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/2d667ff62463f331fba7dddea084d1ededd24b71?ds=inline;hp=2d667ff62463f331fba7dddea084d1ededd24b71 get_file_info(): Don't return filename from quote onwards on error. If `file_name' contained a quote then `cp' points to it, and remains pointing to it if any of concat(), popen(3), or fgets(3) fail to give the expected result. On returning, cp is not NULL and so strdup(cp) is returned. Also, if fgets() fails on Cygwin in the way the comment describes then cp is wrongly free(3)'d. (One of the problems with generic variable names is their overloaded semantics cause faulty re-use.) Fixes b4f2851d and 0c50c669. ---