diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-06-01 16:18:16 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-06-01 16:18:16 +0300 |
commit | 6c0f32b6f37bbb70445731988b5ac180ef054357 (patch) | |
tree | 42aeef0a6c6cba71f38ecd9cae165a48c31f1cf2 | |
parent | b425cc797090c46c3c9ab7b3052d322c4224bd76 (diff) | |
download | vmod-binlog-6c0f32b6f37bbb70445731988b5ac180ef054357.tar.gz vmod-binlog-6c0f32b6f37bbb70445731988b5ac180ef054357.tar.bz2 |
Bugfixes.
* src/binlogsel.c (mkfilename): Return a copy of file name if dir is NULL.
(main): Directory (-D) defaults to cwd.
-rw-r--r-- | src/binlogsel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/binlogsel.c b/src/binlogsel.c index c448bd5..d44c1b8 100644 --- a/src/binlogsel.c +++ b/src/binlogsel.c @@ -512,6 +512,9 @@ 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) |