Lines Matching refs:nwords

246 x_print_expansions(int nwords, char * const *words, bool is_command)
258 (prefix_len = x_longest_prefix(nwords, words)) > 0) {
262 if (nwords == 1)
265 for (i = 0; i < nwords; i++)
270 if (i == nwords) {
275 XPinit(l, nwords + 1);
276 for (i = 0; i < nwords; i++)
394 int nwords;
419 nwords = DOGLOB | DOTILDE | DOMARKDIRS;
424 nwords = 0;
426 expand(yylval.cp, &w, nwords);
430 for (nwords = 0; words[nwords]; nwords++)
432 if (nwords == 1) {
449 x_free_words(nwords, words);
451 nwords = 0;
455 if ((*wordsp = nwords ? words : NULL) == NULL && words != NULL)
456 x_free_words(nwords, words);
458 return (nwords);
489 size_t nwords;
508 nwords = XPsize(w);
510 if (!nwords) {
523 alloc2(nwords, sizeof(struct path_order_info), ATEMP);
524 for (i = 0; i < nwords; i++) {
534 qsort(info, nwords, sizeof(struct path_order_info),
536 for (i = 0; i < nwords; i++)
544 qsort(words, nwords, sizeof(void *), ascpstrcmp);
545 for (i = j = 0; i < nwords - 1; i++) {
552 w.len = nwords = j;
558 return (nwords);
621 int len, nwords = 0;
685 nwords = is_command ?
690 if (nwords == 0) {
699 return (nwords);
706 x_longest_prefix(int nwords, char * const * words)
712 if (nwords <= 0)
716 for (i = 1; i < nwords; i++)
722 /* false for nwords==1 as 0 = words[0][prefix_len] then */
730 x_free_words(int nwords, char **words)
732 while (nwords)
733 afree(words[--nwords], ATEMP);
2780 int start, end, nwords, i;
2783 nwords = x_cf_glob(&i, xbuf, xep - xbuf, xcp - xbuf,
2786 if (nwords == 0) {
2794 while (i < nwords) {
2796 (++i < nwords && x_ins(T1space) < 0)) {
2814 int start, end, nlen, olen, nwords;
2817 nwords = x_cf_glob(&flags, xbuf, xep - xbuf, xcp - xbuf,
2820 if (nwords == 0) {
2825 x_print_expansions(nwords, words,
2828 x_free_words(nwords, words);
2832 nlen = x_longest_prefix(nwords, words);
2833 if (nwords == 1) {
2858 if (type == CT_COMPLIST && nwords > 1) {
2863 x_print_expansions(nwords, words,
2879 if (nwords == 1 && !mksh_cdirsep(words[0][nlen - 1]) &&
2884 x_free_words(nwords, words);
5361 int rval = 0, nwords, start, end, i;
5377 nwords = x_cf_glob(&i, vs->cbuf, vs->linelen, vs->cursor,
5379 if (nwords == 0) {
5389 while (i < nwords) {
5394 if (++i < nwords && putbuf(T1space, 1, false) != 0) {
5414 int rval, nwords, start, end, flags;
5444 nwords = x_cf_glob(&flags, vs->cbuf, vs->linelen, vs->cursor,
5446 if (nwords == 0) {
5454 if (count >= nwords) {
5456 x_print_expansions(nwords, words,
5458 x_free_words(nwords, words);
5469 for (i = 0; i < nwords; i++)
5483 match_len = x_longest_prefix(nwords, words);
5486 is_unique = nwords == 1;
5514 x_free_words(nwords, words);
5529 int start, end, nwords, i;
5533 nwords = x_cf_glob(&i, est->cbuf, est->linelen, est->cursor,
5535 if (nwords == 0) {
5539 x_print_expansions(nwords, words, tobool(i & XCF_IS_COMMAND));
5540 x_free_words(nwords, words);