Lines Matching +full:default +full:- +full:trim
7 /*-
48 #define DOT_NOT 1 /* Don't display dot or dot-dot */
87 int curchoice = -1;
91 static int SearchNoDirErr = 0; /* t_search returns -2 if dir is unreadable */
97 /* do the expand or list on the command line -- SHOULD BE REPLACED */
138 #define isaset(c, w) ((w)[-1] == '=' && \
205 if (cmap(*cp, _ESC) && cp < str_end - 1 && cp[1] == HIST && in tenematch()
213 if (ismetahash(qline.s[qline.len - 1]) in tenematch()
224 * first word of command -> TW_COMMAND in tenematch()
225 * everything else -> TW_ZERO in tenematch()
228 looking = starting_a_command(qline.s + word - 1, qline.s) ? in tenematch()
242 xprintf("%c", *p & QUOTE ? '-' : ' '); in tenematch()
247 xprintf("%c", *p & QUOTE ? '-' : ' '); in tenematch()
262 wordp = p - qline.s; in tenematch()
307 if (search_ret == -2) { in tenematch()
399 DeleteBack(str_end - word_start);/* get rid of old word */ in tenematch()
480 default: in tenematch()
490 return -1; in tenematch()
518 return (-1); in t_glob()
538 av[i - fwd] = av[i]; in t_glob()
541 av[i - fwd] = av[i]; in t_glob()
599 int ndel = (int) (cp ? cpend - cp : 0); in insert_meta()
630 buffer.s[buffer.len - 1] = w; in insert_meta()
641 if (buffer.len != 0 && buffer.s[buffer.len - 1] == qu) { in insert_meta()
643 buffer.s[buffer.len - 1] = '\\'; in insert_meta()
696 if ((*check & TRIM) != (*template & TRIM)) in is_prefix()
714 if ((*check & TRIM) != (*template & TRIM)) { in is_prefixmatch()
715 MCH1 = (*check & TRIM); in is_prefixmatch()
716 MCH2 = (*template & TRIM); in is_prefixmatch()
718 enhanced == 2 && MCH1 == '_' ? '-' : MCH1; in is_prefixmatch()
720 enhanced == 2 && MCH2 == '_' ? '-' : MCH2; in is_prefixmatch()
723 if (enhanced && ((*check & TRIM) == '-' || in is_prefixmatch()
724 (*check & TRIM) == '.' || in is_prefixmatch()
725 (*check & TRIM) == '_')) { in is_prefixmatch()
726 MCH1 = MCH2 = (*check & TRIM); in is_prefixmatch()
728 MCH2 = '-'; in is_prefixmatch()
729 } else if (MCH1 == '-') { in is_prefixmatch()
732 for (; *template && (*template & TRIM) != MCH1 && in is_prefixmatch()
733 (*template & TRIM) != MCH2; template++) in is_prefixmatch()
762 if (c == check || (*--t & TRIM) != (*--c & TRIM)) in is_suffix()
777 if ((vp = adrof(STRfignore)) == NULL || (cp = vp->vec) == NULL) in ignored()
804 count += (*ptr-- == '`')) in starting_a_command()
818 * count is our state machine: 0 looking for anything 1 found white-space in starting_a_command()
819 * looking for non-ws in starting_a_command()
821 for (count = 0; wordstart >= inputline; wordstart--) { in starting_a_command()
825 for (ptr = wordstart, bsl = 0; *(--ptr) == '\\'; bsl++); in starting_a_command()
827 wordstart--; in starting_a_command()
845 (*--wordstart == ' ' || *wordstart == '\t')) in starting_a_command()
852 (*--wordstart == ' ' || *wordstart == '\t')) in starting_a_command()
858 default: in starting_a_command()
883 exp_name->len = 0; in recognize()
889 for (x = exp_name->s, ent = item; *x && (*x & TRIM) == (*ent & TRIM); in recognize()
893 for (x = exp_name->s, ent = item; *x; x++, ent++) { in recognize()
894 MCH1 = *x & TRIM; in recognize()
895 MCH2 = *ent & TRIM; in recognize()
899 if (LCH1 == MCH2 || (MCH1 == '_' && MCH2 == '-')) in recognize()
908 exp_name->len = x - exp_name->s; in recognize()
911 return (-1); /* So stop now and save time */ in recognize()
923 * It returns the -number of ignored items.
937 int text_check = flags & TW_TEXT_CHK;/* Need to check for non-directories */ in tw_collect_items()
963 default: in tw_collect_items()
968 && (vp = adrof(STRautorehash)) != NULL && vp->vec != NULL) in tw_collect_items()
969 for (cp = vp->vec; *cp; cp++) in tw_collect_items()
1017 char *ext = short2str(&item.s[exti -= 4]); in tw_collect_items()
1033 default: in tw_collect_items()
1045 if (name_length == 0) {/* zero-length word can't be misspelled */ in tw_collect_items()
1046 exp_name->len = 0; /* (not trying is important for ~) */ in tw_collect_items()
1060 if (!(exec_check && !executable(exp_dir->s, item.s, dir_ok))) { in tw_collect_items()
1061 exp_name->len = 0; in tw_collect_items()
1070 if (spdir(exp_name, exp_dir->s, item.s, target)) { in tw_collect_items()
1072 !executable(exp_dir->s, exp_name->s, dir_ok)) in tw_collect_items()
1092 if ((vp = adrof(STRcomplete)) != NULL && vp->vec != NULL) in tw_collect_items()
1093 for (cp = vp->vec; *cp; cp++) { in tw_collect_items()
1110 if (exec_check && !executable(exp_dir->s, item.s, dir_ok)) in tw_collect_items()
1113 if (dir_check && !isadirectory(exp_dir->s, item.s)) in tw_collect_items()
1116 if (text_check && isadirectory(exp_dir->s, item.s)) in tw_collect_items()
1124 (dir_check || !isadirectory(exp_dir->s, item.s))) in tw_collect_items()
1139 if (filetype(exp_dir->s, item.s) == '/') in tw_collect_items()
1145 Strbuf_append1(&buf, filetype(exp_dir->s, item.s)); in tw_collect_items()
1148 default: in tw_collect_items()
1176 exp_name->len = 0; in tw_collect_items()
1189 if (enhanced && exp_name->len < name_length) { in tw_collect_items()
1190 exp_name->len = 0; in tw_collect_items()
1197 default: in tw_collect_items()
1207 if ((cnt <= curchoice) || (curchoice == -1)) { in tw_collect_items()
1208 curchoice = -1; in tw_collect_items()
1212 if (curchoice < -1) in tw_collect_items()
1213 curchoice = cnt - 1; in tw_collect_items()
1224 return -nignored; in tw_collect_items()
1253 if ((vp = adrof(exp_name)) != NULL && vp->vec != NULL) { in tw_suffix()
1254 if ((ptr = vp->vec[0]) == NULL || *ptr == '\0' || in tw_suffix()
1255 vp->vec[1] != NULL) in tw_suffix()
1261 if ((dol = Strrchr(word->s, '$')) != 0 && in tw_suffix()
1290 default: in tw_suffix()
1306 word->len = 0; in tw_fixword()
1311 if ((ptr = Strrchr(word->s, '$')) != NULL) { in tw_fixword()
1313 word->len = ptr + 1 - word->s; /* Delete after the dollar */ in tw_fixword()
1315 word->len = 0; in tw_fixword()
1321 word->len = 0; in tw_fixword()
1325 default: in tw_fixword()
1326 word->len = 0; in tw_fixword()
1337 * Collect items. Return -1 in case we were interrupted or
1367 ni = -1; /* flag error */ in tw_collect()
1400 * (by default interpreted as 'items', for backwards compatibility)
1418 max_items = max_items * 10 + *ptr++ - '0'; in tw_list_items()
1434 max_rows = max_rows * 10 + *ptr++ - '0'; in tw_list_items()
1532 extract_dir_and_name(word->s, &dir, &name); in t_search()
1538 * foo$variable -> TW_VARIABLE in t_search()
1539 * ~user -> TW_LOGNAME in t_search()
1542 if ((*word->s == '~') && (Strchr(word->s, '/') == NULL)) { in t_search()
1564 if (exp_dir.len != 0 && exp_dir.s[exp_dir.len - 1] != '/') in t_search()
1573 res = -1; in t_search()
1581 if (Strchr(word->s, '/') || (looking & TW_PATH)) { in t_search()
1588 if (looking == TW_COMMAND && word->len == 0) { in t_search()
1589 res = -1; in t_search()
1611 default: in t_search()
1659 * from a user-interface point of view, since it does not in t_search()
1667 if (dir.s[dir.len - 1] != '/') in t_search()
1672 if (word->len != 0 && word->s[word->len - 1] != '/') { in t_search()
1703 res = -1; in t_search()
1706 if (exp_dir.len != 0 && exp_dir.s[exp_dir.len - 1] != '/') { in t_search()
1727 target = name = Strsave(word->s); /* so it can match things */ in t_search()
1730 default: in t_search()
1737 user_name = word->s + 1; in t_search()
1742 user_name = word->s; in t_search()
1762 target = name = Strsave(word->s); /* so it can match things */ in t_search()
1765 default: in t_search()
1770 res = -1; in t_search()
1777 if (numitems == -1) in t_search()
1800 default: /* completion specified suffix */ in t_search()
1818 default: in t_search()
1849 Strbuf_appendn(dir, path, p - path); in extract_dir_and_name()
1880 * or =<stack-entry> to <dir in stack entry>
1887 new->len = 0; in tilde()
1895 name = Strnsave(old, o - old); in tilde()
1905 if (new->s[0] == '/' && new->len == 1 && *o == '/') in tilde()
1921 default: in tilde()
1930 return -1; in tilde()
1948 !(nd = dnormalize(edir->len ? edir->s : STRdot, in expand_dir()
1954 return (-2); in expand_dir()
1960 xprintf("\n%S %s\n", edir->len ? edir->s : (tdir ? tdir : dir), in expand_dir()
1966 return (-1); in expand_dir()
1976 slash = edir->len != 0 && edir->s[edir->len - 1] == '/'; in expand_dir()
1977 edir->len = 0; in expand_dir()
1979 if (slash != 0 && edir->s[edir->len - 1] != '/') in expand_dir()
2001 if ((vp = adrof(STRnostat)) == NULL || (cp = vp->vec) == NULL) in nostat()
2031 if (lstat(ptr, &statb) != -1) { in filetype()
2035 if (stat(ptr, &statb) == -1) in filetype()
2063 p2 = strspl(ptr, "+"); /* Must append a '+' and re-stat(). */ in filetype()
2064 if ((stat(p2, &hpstatb) != -1) && S_ISCDF(hpstatb.st_mode)) { in filetype()
2145 rows = (count + (columns - 1)) / columns; in find_rows()
2179 rows = (count + (columns - 1)) / columns; in print_by_column()
2181 i = -1; in print_by_column()
2193 Char f = items[i][w - 1]; in print_by_column()
2194 items[i][w - 1] = 0; in print_by_column()
2195 print_with_color(items[i], w - 1, f); in print_by_column()
2196 items[i][w - 1] = f; in print_by_column()
2210 xprintf("%-S%c", items[i], filetype(dir, items[i])); in print_by_column()
2215 if (c < (columns - 1)) { /* Not last column? */ in print_by_column()
2240 for (; *str1 && samecase(*str1 & TRIM) == samecase(*str2 & TRIM); in StrQcmp()
2246 * end-of-string NUL. in StrQcmp()
2251 return (-1); in StrQcmp()
2255 return ((*str1 & TRIM) - (*str2 & TRIM)); in StrQcmp()
2279 while (*des && --count > 0) in catn()
2281 while (--count > 0) in catn()
2295 while (--count != 0) in copyn()
2303 * like it's normal string counter-part
2338 new_scroll->element = Strsave(item); in add_scroll_tab()
2339 new_scroll->next = scroll_tab; in add_scroll_tab()
2353 for (loop = scroll_tab; loop && (tmp >= 0); loop = loop->next) in choose_scroll_tab()
2354 ptr[--tmp] = loop->element; in choose_scroll_tab()
2358 exp_name->len = 0; in choose_scroll_tab()
2371 scroll_tab = scroll_tab->next; in free_scroll_tab()
2372 xfree(loop->element); in free_scroll_tab()