Strip blank end/front of filenames
authorJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 10:18:57 +0000 (11:18 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 13 Mar 2007 10:18:57 +0000 (11:18 +0100)
We do this for other options.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
init.c

diff --git a/init.c b/init.c
index ba932bf..888e68b 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1111,7 +1111,13 @@ static int str_filename_cb(void *data, const char *input)
 
        td->nr_files = 0;
        p = str = strdup(input);
+
+       strip_blank_front(&str);
+       strip_blank_end(str);
+
        while ((fname = strsep(&str, ":")) != NULL) {
+               if (!strlen(fname))
+                       break;
                add_file(td, fname);
                td->nr_files++;
        }