Home | History | Annotate | Download | only in src

Lines Matching refs:words

240 x_print_expansions(int nwords, char * const *words, bool is_command)
252 (prefix_len = x_longest_prefix(nwords, words)) > 0) {
257 prefix_len = x_basename(words[0], NULL);
260 if (x_basename(words[i] + prefix_len, NULL) >
266 !mksh_cdirsep(words[0][prefix_len - 1]))
271 XPput(l, words[i] + prefix_len);
284 pr_list(&co, use_copy ? (char **)XPptrv(l) : words);
387 char **words, *cp;
396 * Convert "foo*" (toglob) to an array of strings (words)
422 words = (char **)XPclose(w);
424 for (nwords = 0; words[nwords]; nwords++)
440 if ((strcmp(words[0], toglob) == 0 &&
441 stat(words[0], &statb) < 0) ||
442 words[0][0] == '\0') {
443 x_free_words(nwords, words);
444 words = NULL;
449 if ((*wordsp = nwords ? words : NULL) == NULL && words != NULL)
450 x_free_words(nwords, words);
513 char **words = (char **)XPptrv(w);
519 info[i].word = words[i];
520 info[i].base = x_basename(words[i], NULL);
522 strncmp(words[i], last_info->word, info[i].base) != 0) {
531 words[i] = info[i].word;
535 char **words = (char **)XPptrv(w);
538 qsort(words, nwords, sizeof(void *), xstrcmp);
540 if (strcmp(words[i], words[i + 1]))
541 words[j++] = words[i];
543 afree(words[i], ATEMP);
545 words[j++] = words[i];
617 char **words = NULL;
680 x_command_glob(*flagsp, toglob, &words) :
681 x_file_glob(flagsp, toglob, &words);
690 *wordsp = words;
700 x_longest_prefix(int nwords, char * const * words)
709 prefix_len = strlen(words[0]);
711 for (j = 0, p = words[i]; j < prefix_len; j++)
712 if (p[j] != words[0][j]) {
716 /* false for nwords==1 as 0 = words[0][prefix_len] then */
717 if (UTFMODE && prefix_len && (words[0][prefix_len] & 0xC0) == 0x80)
718 while (prefix_len && (words[0][prefix_len] & 0xC0) != 0xC0)
724 x_free_words(int nwords, char **words)
727 afree(words[--nwords], ATEMP);
728 afree(words, ATEMP);
791 char *xp, **words;
830 words = (char **)XPptrv(*wp);
832 if (ksh_access(words[i], X_OK) == 0) {
833 words[j] = words[i];
835 memmove(words[j], words[j] + pathlen,
836 strlen(words[j] + pathlen) + 1);
839 afree(words[i], ATEMP);
2698 char **words;
2703 &start, &end, &words);
2714 if (x_escape(words[i], strlen(words[i]), x_do_ins) < 0 ||
2732 char **words;
2737 &start, &end, &words);
2744 x_print_expansions(nwords, words,
2747 x_free_words(nwords, words);
2751 nlen = x_longest_prefix(nwords, words);
2773 completed = !strncmp(words[0], unescaped, strlen(unescaped));
2782 x_print_expansions(nwords, words,
2791 x_escape(words[0], nlen, x_do_ins);
2798 if (nwords == 1 && !mksh_cdirsep(words[0][nlen - 1]) &&
2803 x_free_words(nwords, words);
3185 /* Uppercase N(1) words */
3192 /* Lowercase N(1) words */
3199 /* Titlecase N(1) words */
3212 * to UPPER CASE, lower case or Capitalise Words.
5281 char **words;
5297 &start, &end, &words);
5309 if (x_escape(words[i], strlen(words[i]), x_vi_putbuf) != 0) {
5335 char **words;
5364 &start, &end, &words);
5375 x_print_expansions(nwords, words,
5377 x_free_words(nwords, words);
5385 match = words[count] +
5386 x_basename(words[count], NULL);
5390 strcmp(words[i] + x_basename(words[i],
5392 match = words[count];
5396 match = words[count];
5401 match = words[0];
5402 match_len = x_longest_prefix(nwords, words);
5433 x_free_words(nwords, words);
5449 char **words;
5453 &start, &end, &words);
5458 x_print_expansions(nwords, words, tobool(i & XCF_IS_COMMAND));
5459 x_free_words(nwords, words);