ii

My fork of https://tools.suckless.org/ii/
git clone https://git.inz.fi/ii
Log | Files | Refs | README | LICENSE

commit bcda412c5dedfd2b522d471659ca83de2aedf827
parent 2fec6ab70dfe1108ed1d0c20465922e237c38f2f
Author: nion@noname <unknown>
Date:   Wed, 21 Dec 2005 22:00:31 +0100

Nico Golde <nion@wmii.de>
some modifications to prepare -rc2 release

Diffstat:
MREADME | 7+++++--
Mconfig.mk | 2+-
Mii.c | 18++++++++----------
3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/README b/README @@ -32,7 +32,10 @@ program and for example with vim. Run vim in the server directory and use key mapping like: map w1 :.w >> \#ii/in<cr> map w2 :.w >> \#wmii/in<cr> -to post to channels. Thanks to Matthias Kopfermann for this hint. +to post to channels. +If you use the next editor line for a new posting you can use ctrl-p for nick +completion if you wrote the nick in the past. +Thanks to Matthias Kopfermann for this hint. Configuration ------------- @@ -43,4 +46,4 @@ Contact If you want to contact the developers just write a mail to ii (at) modprobe (dot) de ---Nico Golde, Anselm R. Garbe +-- Nico Golde, Anselm R. Garbe diff --git a/config.mk b/config.mk @@ -6,7 +6,7 @@ MANPREFIX = ${PREFIX}/share/man INCDIR = ${PREFIX}/include LIBDIR = ${PREFIX}/lib -VERSION = 1-rc1 +VERSION = 1-rc2 # includes and libs INCLUDES = -I. -I${INCDIR} -I/usr/include diff --git a/ii.c b/ii.c @@ -27,7 +27,7 @@ enum { TOK_NICKSRV = 0, TOK_USER, TOK_CMD, TOK_CHAN, TOK_ARG, TOK_TEXT, TOK_LAST }; static int irc; -static char *fifo[256]; +static char *fifo[_POSIX_PATH_MAX]; static char *server = "irc.freenode.net"; static char nick[32]; /* might change while running */ static char path[_POSIX_PATH_MAX]; @@ -107,7 +107,7 @@ static size_t tokenize(char **result, size_t reslen, char *str, char delim) } /* creates directories top-down, if necessary */ -static void _mkdir(const char *dir) +static void create_lastdir(const char *dir) { char tmp[256]; char *p; @@ -120,21 +120,19 @@ static void _mkdir(const char *dir) for(p = tmp + 1; *p; p++) if(*p == '/') { *p = 0; - if(access(tmp, F_OK)) - mkdir(tmp, S_IRWXU); + mkdir(tmp, S_IRWXU); *p = '/'; } - if(access(tmp, F_OK)) - mkdir(tmp, S_IRWXU); + mkdir(tmp, S_IRWXU); } -static int _create_filepath(char *filepath, size_t len, char *channel, +static int get_filepath(char *filepath, size_t len, char *channel, char *file) { if(channel) { if(!snprintf(filepath, len, "%s/%s", path, channel)) return 0; - _mkdir(filepath); + create_lastdir(filepath); return snprintf(filepath, len, "%s/%s/%s", path, channel, file); } return snprintf(filepath, len, "%s/%s", path, file); @@ -143,7 +141,7 @@ static int _create_filepath(char *filepath, size_t len, char *channel, static void create_filepath(char *filepath, size_t len, char *channel, char *suffix) { - if(!_create_filepath(filepath, len, channel, suffix)) { + if(!get_filepath(filepath, len, channel, suffix)) { fprintf(stderr, "%s", "ii: path to irc directory too long\n"); exit(EXIT_FAILURE); } @@ -470,7 +468,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "%s", "ii: path to irc directory too long\n"); exit(EXIT_FAILURE); } - _mkdir(path); + create_lastdir(path); for(i = 0; i < 256; i++) fifo[i] = 0;