X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=interactive.c;h=1376cf1d72739b3f7c9c3218dd96666a5d475812;hb=HEAD;hp=6c9110fd66e23cae6b8de5f80db834738565c64d;hpb=82aedc35a6cdf2c7e0d27fc16f75529722505dac;p=paraslash.git diff --git a/interactive.c b/interactive.c index 6c9110fd..1376cf1d 100644 --- a/interactive.c +++ b/interactive.c @@ -287,7 +287,7 @@ static int i9e_post_monitor(__a_unused struct sched *s, __a_unused void *context char *buf; size_t sz, consumed = 0; - ret = -E_I9E_EOF; + ret = -E_EOF; if (i9ep->input_eof) goto rm_btrn; ret = -E_I9E_TERM_RQ; @@ -306,7 +306,7 @@ static int i9e_post_monitor(__a_unused struct sched *s, __a_unused void *context goto rm_btrn; } if (ret == 0) { - ret = -E_I9E_EOF; + ret = -E_EOF; goto rm_btrn; } buf[1] = '\0'; @@ -634,7 +634,7 @@ int i9e_poll(struct pollfd *fds, nfds_t nfds, int timeout) int i9e_extract_completions(const char *word, char **string_list, char ***result) { - char **matches = para_malloc(sizeof(char *)); + char **matches = alloc(sizeof(char *)); int match_count = 0, matches_len = 1; char **p; int len = strlen(word); @@ -645,8 +645,8 @@ int i9e_extract_completions(const char *word, char **string_list, match_count++; if (match_count >= matches_len) { matches_len *= 2; - matches = para_realloc(matches, - matches_len * sizeof(char *)); + matches = arr_realloc(matches, matches_len, + sizeof(char *)); } matches[match_count - 1] = para_strdup(*p); } @@ -682,7 +682,7 @@ char **i9e_complete_commands(const char *word, struct i9e_completer *completers) if (is_prefix(word, cmd, len)) match_count++; } - matches = para_malloc((match_count + 1) * sizeof(*matches)); + matches = arr_alloc(match_count + 1, sizeof(*matches)); for (i = 0, match_count = 0; (cmd = completers[i].name); i++) if (is_prefix(word, cmd, len)) matches[match_count++] = para_strdup(cmd); @@ -766,7 +766,7 @@ int i9e_print_completions(struct i9e_completer *completers) if (*p == ' ') p++; n = end - p + 1; - ci.word = para_malloc(n + 1); + ci.word = alloc(n + 1); strncpy(ci.word, p, n); ci.word[n] = '\0'; create_matches: