i don't really know if it's a good idea. the idea is: i want ii to
behave the way i want by default. as dwm can be configured with
a config.h, i feel ii should get the same feature.

regards.
marc

* SET_PREFIX() macro
---
 config.h.sample | 1 +
 ii.c            | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 config.h.sample

diff --git a/config.h.sample b/config.h.sample
new file mode 100644
index 0000000..0eb6a47
--- /dev/null
+++ b/config.h.sample
@@ -0,0 +1 @@
+#define SET_PREFIX() snprintf(prefix, sizeof(prefix), "%s/irc", spw->pw_dir);
diff --git a/ii.c b/ii.c
index 55d5f52..7f484c3 100644
--- a/ii.c
+++ b/ii.c
@@ -1,4 +1,5 @@
 /* See LICENSE file for license details. */
+#include "config.h"
 #include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
@@ -790,7 +791,7 @@ main(int argc, char *argv[])
                exit(1);
        }
        strlcpy(nick, spw->pw_name, sizeof(nick));
-       snprintf(prefix, sizeof(prefix), "%s/irc", spw->pw_dir);
+    SET_PREFIX();
 
        ARGBEGIN {
        case 'f':
-- 
2.20.1


Reply via email to