[wiki] [sites] Added new sic patch. Which allows the user to define the nickname in config.def.h instead of using getenv() || qorg11

From: <git_AT_suckless.org>
Date: Wed, 08 Jul 2020 19:41:45 +0200

commit 05b4814b953d023d68ec29668ef27667bee0dc09
Author: qorg11 <qorg_AT_vxempire.xyz>
Date: Wed Jul 8 19:41:17 2020 +0200

    Added new sic patch. Which allows the user to define the nickname in
    config.def.h instead of using getenv()

diff --git a/tools.suckless.org/sic/patches/defined_nickname/index.md b/tools.suckless.org/sic/patches/defined_nickname/index.md
new file mode 100644
index 00000000..cfca520d
--- /dev/null
+++ b/tools.suckless.org/sic/patches/defined_nickname/index.md
_AT_@ -0,0 +1,9 @@
+# Define username in config.def.h
+
+This patch allows to define the username in config.def.h instead of using getenv()
+
+The constant name is `NICK` and its default value is `maniac`
+
+## Download
+
+* <sic-definednickname-20668b.diff>
diff --git a/tools.suckless.org/sic/patches/defined_nickname/sic-definednickname-20200708-7f0141b.diff b/tools.suckless.org/sic/patches/defined_nickname/sic-definednickname-20200708-7f0141b.diff
new file mode 100644
index 00000000..34065140
--- /dev/null
+++ b/tools.suckless.org/sic/patches/defined_nickname/sic-definednickname-20200708-7f0141b.diff
_AT_@ -0,0 +1,27 @@
+diff --git config.def.h config.def.h
+index ce5b9b7..6d720e9 100644
+--- config.def.h
++++ config.def.h
+_AT_@ -4,9 +4,6 @@
+ /* Port used when "-p" is not given */
+ #define DEFAULT_PORT "6667"
+
+-/* Nickname when "-n" is not given */
+-#define NICK "maniac"
+-
+ /* Timestamp format; see strftime(3). */
+ #define TIMESTAMP_FORMAT "%Y-%m-%d %R"
+
+diff --git sic.c sic.c
+index 72d6026..ecefaf2 100644
+--- sic.c
++++ sic.c
+_AT_@ -146,7 +146,7 @@ usage(void) {
+ int
+ main(int argc, char *argv[]) {
+ struct timeval tv;
+- const char *user = NICK;
++ const char *user = getenv("USER");
+ int n;
+ fd_set rd;
+
Received on Wed Jul 08 2020 - 19:41:45 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 08 2020 - 19:48:43 CEST