core/path: add one more assert
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 25 Feb 2018 20:59:04 +0000 (21:59 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 26 Feb 2018 14:49:27 +0000 (15:49 +0100)
src/core/path.c

index 8a5ec0a..1893d8d 100644 (file)
@@ -80,7 +80,8 @@ int path_spec_watch(PathSpec *s, sd_event_io_handler_t handler) {
 
         (void) sd_event_source_set_description(s->event_source, "path");
 
-        /* This assumes the path was passed through path_kill_slashes()! */
+        /* This function assumes the path was passed through path_kill_slashes()! */
+        assert(!strstr(s->path, "//"));
 
         for (slash = strchr(s->path, '/'); ; slash = strchr(slash+1, '/')) {
                 char *cut = NULL;