Lines Matching refs:words
226 x_print_expansions(int nwords, char * const *words, bool is_command)
237 (prefix_len = x_longest_prefix(nwords, words)) > 0) {
242 prefix_len = x_basename(words[0], NULL);
245 if (x_basename(words[i] + prefix_len, NULL) >
250 while (prefix_len > 0 && words[0][prefix_len - 1] != '/')
255 XPput(l, words[i] + prefix_len);
264 pr_list(use_copy ? (char **)XPptrv(l) : words);
367 char **words, *cp;
376 * Convert "foo*" (toglob) to an array of strings (words)
402 words = (char **)XPclose(w);
404 for (nwords = 0; words[nwords]; nwords++)
420 if ((strcmp(words[0], toglob) == 0 &&
421 stat(words[0], &statb) < 0) ||
422 words[0][0] == '\0') {
423 x_free_words(nwords, words);
424 words = NULL;
429 if ((*wordsp = nwords ? words : NULL) == NULL && words != NULL)
430 x_free_words(nwords, words);
488 char **words = (char **)XPptrv(w);
494 info[i].word = words[i];
495 info[i].base = x_basename(words[i], NULL);
497 strncmp(words[i], last_info->word, info[i].base) != 0) {
506 words[i] = info[i].word;
510 char **words = (char **)XPptrv(w);
513 qsort(words, nwords, sizeof(void *), xstrcmp);
515 if (strcmp(words[i], words[i + 1]))
516 words[j++] = words[i];
518 afree(words[i], ATEMP);
520 words[j++] = words[i];
592 char **words = NULL;
655 x_command_glob(*flagsp, toglob, &words) :
656 x_file_glob(flagsp, toglob, &words);
665 *wordsp = words;
675 x_longest_prefix(int nwords, char * const * words)
684 prefix_len = strlen(words[0]);
686 for (j = 0, p = words[i]; j < prefix_len; j++)
687 if (p[j] != words[0][j]) {
691 /* false for nwords==1 as 0 = words[0][prefix_len] then */
692 if (UTFMODE && prefix_len && (words[0][prefix_len] & 0xC0) == 0x80)
693 while (prefix_len && (words[0][prefix_len] & 0xC0) != 0xC0)
699 x_free_words(int nwords, char **words)
702 afree(words[--nwords], ATEMP);
703 afree(words, ATEMP);
764 char *xp, **words;
803 words = (char **)XPptrv(*wp);
805 if (ksh_access(words[i], X_OK) == 0) {
806 words[j] = words[i];
808 memmove(words[j], words[j] + pathlen,
809 strlen(words[j] + pathlen) + 1);
812 afree(words[i], ATEMP);
2670 char **words;
2675 &start, &end, &words);
2686 if (x_escape(words[i], strlen(words[i]), x_do_ins) < 0 ||
2704 char **words;
2709 &start, &end, &words);
2716 x_print_expansions(nwords, words,
2719 x_free_words(nwords, words);
2723 nlen = x_longest_prefix(nwords, words);
2745 completed = !strncmp(words[0], unescaped, strlen(unescaped));
2754 x_print_expansions(nwords, words,
2763 x_escape(words[0], nlen, x_do_ins);
2770 if (nwords == 1 && words[0][nlen - 1] != '/' &&
2775 x_free_words(nwords, words);
3154 /* Uppercase N(1) words */
3161 /* Lowercase N(1) words */
3168 /* Titlecase N(1) words */
3181 * to UPPER CASE, lower case or Capitalise Words.
5235 char **words;
5251 &start, &end, &words);
5263 if (x_escape(words[i], strlen(words[i]), x_vi_putbuf) != 0) {
5289 char **words;
5318 &start, &end, &words);
5329 x_print_expansions(nwords, words,
5331 x_free_words(nwords, words);
5339 match = words[count] +
5340 x_basename(words[count], NULL);
5344 strcmp(words[i] + x_basename(words[i],
5346 match = words[count];
5350 match = words[count];
5355 match = words[0];
5356 match_len = x_longest_prefix(nwords, words);
5387 x_free_words(nwords, words);
5403 char **words;
5407 &start, &end, &words);
5412 x_print_expansions(nwords, words, tobool(i & XCF_IS_COMMAND));
5413 x_free_words(nwords, words);