From 6c0f32b6f37bbb70445731988b5ac180ef054357 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 1 Jun 2014 16:18:16 +0300 Subject: Bugfixes. * src/binlogsel.c (mkfilename): Return a copy of file name if dir is NULL. (main): Directory (-D) defaults to cwd. --- src/binlogsel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/binlogsel.c b/src/binlogsel.c index c448bd5..d44c1b8 100644 --- a/src/binlogsel.c +++ b/src/binlogsel.c @@ -511,7 +511,10 @@ mkfilename(const char *dir, const char *file) { size_t dirlen, size; char *ret; - + + if (!dir) + return xstrdup(file); + dirlen = strlen(dir); while (dirlen > 0 && dir[dirlen-1] == '/') --dirlen; @@ -1082,6 +1085,8 @@ main(int argc, char **argv) } else if (pattern) { selglob(directory, convpattern(pattern)); } else { + if (!directory) + directory = "."; selidx_year(directory); } if (module_done) -- cgit v1.2.1