Welcome to little lamb

Code » anopa » commit d720115

enable: Add comment on why listdir before args

author Olivier Brunel
2015-04-03 17:05:44 UTC
committer Olivier Brunel
2015-04-04 12:47:37 UTC
parent 1c82e87eb8b18715997977bdfcc4603a30a5b91d

enable: Add comment on why listdir before args

src/anopa/aa-enable.c +3 -0

diff --git a/src/anopa/aa-enable.c b/src/anopa/aa-enable.c
index 236cb9e..4c37d54 100644
--- a/src/anopa/aa-enable.c
+++ b/src/anopa/aa-enable.c
@@ -284,6 +284,9 @@ main (int argc, char * const argv[])
             strerr_diefu2sys (1, "init repository ", path_repo);
     }
 
+    /* process listdir (path_list) first, to ensure if the service was also
+     * specified on cmdline (and will fail: already exists) the one processed is
+     * the one with (potentially) a config dir */
     if (path_list)
     {
         stralloc_catb (&sa_pl, path_list, strlen (path_list) + 1);