Lines Matching refs:len

240 	size_t len;  in _default_history_file()  local
248 len = strlen(p->pw_dir) + sizeof("/.history"); in _default_history_file()
249 if ((path = el_malloc(len)) == NULL) in _default_history_file()
252 (void)snprintf(path, len, "%s/.history", p->pw_dir); in _default_history_file()
534 size_t len, with_len, what_len; in _rl_compat_sub() local
536 len = strlen(str); in _rl_compat_sub()
544 len += with_len - what_len; in _rl_compat_sub()
551 r = result = el_calloc(len + 1, sizeof(*r)); in _rl_compat_sub()
578 size_t len; in get_history_event() local
633 len = (size_t)idx - (size_t)begin; in get_history_event()
636 if (sub && len == 0 && last_search_pat && *last_search_pat) in get_history_event()
638 else if (len == 0) in get_history_event()
641 if ((pat = el_calloc(len + 1, sizeof(*pat))) == NULL) in get_history_event()
643 (void)strlcpy(pat, cmd + begin, len + 1); in get_history_event()
671 if (sub && len) { in get_history_event()
694 size_t len = 0; in getfrom() local
705 if (len - 1 >= size) { in getfrom()
717 what[len++] = *cmd; in getfrom()
719 what[len] = '\0'; in getfrom()
755 size_t len = 0; in getto() local
764 if (len + from_len + 1 >= size) { in getto()
774 strcpy(&with[len], from); in getto()
775 len += from_len; in getto()
780 with[len++] = *cmd; in getto()
784 with[len] = '\0'; in getto()
1023 #define ADD_STRING(what, len, fr) \ in history_expand() argument
1025 if (idx + len + 1 > size) { \ in history_expand()
1027 (size += len + 1) * sizeof(*nresult)); \ in history_expand()
1035 (void)strlcpy(&result[idx], what, len + 1); \ in history_expand()
1036 idx += len; \ in history_expand()
1044 size_t len, start, j; in history_expand() local
1053 len = strlen(&str[j + 1]) + 1; in history_expand()
1054 memmove(&str[j], &str[j + 1], len); in history_expand()
1079 len = i - start; in history_expand()
1080 ADD_STRING(&str[start], len, NULL); in history_expand()
1083 len = j - i; in history_expand()
1084 ADD_STRING(&str[i], len, NULL); in history_expand()
1093 len = strlen(tmp); in history_expand()
1094 ADD_STRING(tmp, len, tmp); in history_expand()
1126 size_t i, len, max; in history_arg_extract() local
1152 for (i = (size_t)start, len = 0; i <= (size_t)end; i++) in history_arg_extract()
1153 len += strlen(arr[i]) + 1; in history_arg_extract()
1154 len++; in history_arg_extract()
1155 result = el_calloc(len, sizeof(*result)); in history_arg_extract()
1159 for (i = (size_t)start, len = 0; i <= (size_t)end; i++) { in history_arg_extract()
1160 (void)strcpy(result + len, arr[i]); in history_arg_extract()
1161 len += strlen(arr[i]); in history_arg_extract()
1163 result[len++] = ' '; in history_arg_extract()
1165 result[len] = '\0'; in history_arg_extract()
1183 size_t len; in history_tokenize() local
1216 len = (size_t)i - (size_t)start; in history_tokenize()
1217 temp = el_calloc(len + 1, sizeof(*temp)); in history_tokenize()
1224 (void)strlcpy(temp, &str[start], len + 1); in history_tokenize()
1943 rl_display_match_list(char **matches, int len, int max) in rl_display_match_list() argument
1946 fn_display_match_list(e, matches, (size_t)len, (size_t)max, in rl_display_match_list()
2313 size_t len; in rl_copy_text() local
2330 len = (size_t)(to - from); in rl_copy_text()
2331 out = el_malloc((size_t)len + 1); in rl_copy_text()
2334 (void)strlcpy(out, li->buffer + from , len); in rl_copy_text()
2398 size_t len, max, i, j, min; in rl_completion_matches() local
2401 len = 1; in rl_completion_matches()
2406 while ((match = (*fun)(str, (int)(len - 1))) != NULL) { in rl_completion_matches()
2407 list[len++] = match; in rl_completion_matches()
2408 if (len == max) { in rl_completion_matches()
2416 if (len == 1) in rl_completion_matches()
2418 list[len] = NULL; in rl_completion_matches()
2419 if (len == 2) { in rl_completion_matches()
2424 qsort(&list[1], len - 1, sizeof(*list), in rl_completion_matches()
2427 for (i = 1, a = list[i]; i < len - 1; i++, a = b) { in rl_completion_matches()