New CLEAR command, removes all rules from a list
[rxpd] / src / rxpd_file.c
index 4d6c278..ba0226e 100644 (file)
@@ -60,6 +60,17 @@ rxpd_file_delete (struct rxpd_file* self)
     {
       rxpd_file_rules_delete (self);
       psplay_remove (&self->base->files, &self->node);
+
+      while (1) 
+        {
+          remove ((char*)self->node.key);
+          char* slash = strrchr ((char*)self->node.key, '/');
+          if (slash)
+            *slash = '\0';
+          else
+            break;
+        }
+
       free ((void*)self->node.key);
       free (self);
     }