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);
2695 char **words;
2700 &start, &end, &words);
2711 if (x_escape(words[i], strlen(words[i]), x_do_ins) < 0 ||
2729 char **words;
2734 &start, &end, &words);
2741 x_print_expansions(nwords, words,
2744 x_free_words(nwords, words);
2748 nlen = x_longest_prefix(nwords, words);
2770 completed = !strncmp(words[0], unescaped, strlen(unescaped));
2779 x_print_expansions(nwords, words,
2788 x_escape(words[0], nlen, x_do_ins);
2795 if (nwords == 1 && words[0][nlen - 1] != '/' &&
2800 x_free_words(nwords, words);
3179 /* Uppercase N(1) words */
3186 /* Lowercase N(1) words */
3193 /* Titlecase N(1) words */
3206 * to UPPER CASE, lower case or Capitalise Words.
5290 char **words;
5306 &start, &end, &words);
5318 if (x_escape(words[i], strlen(words[i]), x_vi_putbuf) != 0) {
5344 char **words;
5373 &start, &end, &words);
5384 x_print_expansions(nwords, words,
5386 x_free_words(nwords, words);
5394 match = words[count] +
5395 x_basename(words[count], NULL);
5399 strcmp(words[i] + x_basename(words[i],
5401 match = words[count];
5405 match = words[count];
5410 match = words[0];
5411 match_len = x_longest_prefix(nwords, words);
5442 x_free_words(nwords, words);
5458 char **words;
5462 &start, &end, &words);
5467 x_print_expansions(nwords, words, tobool(i & XCF_IS_COMMAND));
5468 x_free_words(nwords, words);