Lines Matching +full:bat +full:- +full:present
4 /*-
55 * As we search for the command we note the first non-trivial error
76 * (possibly) present in the i'th component of the variable path, look
92 (1UL << (i & (widthof(t) - 1))))
94 (1UL << (i & (widthof(t) - 1))))
116 * whether ``name'' is (possibly) present in the i'th component
123 # define HSHMASK (HSHSIZ - 1)
159 blk[0] = t->t_dcom[0]; in doexec()
192 av = &t->t_dcom[1]; in doexec()
205 blkfree(t->t_dcom); in doexec()
208 t->t_dcom = blkspl(pv, av); in doexec()
211 av = t->t_dcom; in doexec()
217 xechoit(av); /* Echo command if -x */ in doexec()
251 if (v == NULL || v->vec == NULL || v->vec[0] == NULL || slash) in doexec()
254 opv = v->vec; in doexec()
313 hits--; in doexec()
407 if ((fd = xopen(f, O_RDONLY|O_LARGEFILE)) != -1) { in texec()
440 if (fd == -1 || in texec()
441 pref[0] != '#' || pref[1] != '!' || hashbang(fd, &vp) == -1) { in texec()
449 if (v == NULL || v->vec == NULL) { in texec()
454 if (fd != -1 in texec()
464 vp = saveblk(v->vec); in texec()
468 if (fd != -1) in texec()
540 sigaction(SIGINT, &state->sigint, NULL); in execash_cleanup()
541 sigaction(SIGQUIT, &state->sigquit, NULL); in execash_cleanup()
542 sigaction(SIGTERM, &state->sigterm, NULL); in execash_cleanup()
546 didcch = state->didcch; in execash_cleanup()
548 didfds = state->didfds; in execash_cleanup()
553 close_on_exec(SHIN = dmove(state->saveIN, state->SHIN), 1); in execash_cleanup()
554 close_on_exec(SHOUT = dmove(state->saveOUT, state->SHOUT), 1); in execash_cleanup()
555 close_on_exec(SHDIAG = dmove(state->saveDIAG, state->SHDIAG), 1); in execash_cleanup()
556 close_on_exec(OLDSTD = dmove(state->saveSTD, state->OLDSTD), 1); in execash_cleanup()
588 (void)close_on_exec (state.saveIN = dcopy(SHIN, -1), 1); in execash()
589 (void)close_on_exec (state.saveOUT = dcopy(SHOUT, -1), 1); in execash()
590 (void)close_on_exec (state.saveDIAG = dcopy(SHDIAG, -1), 1); in execash()
591 (void)close_on_exec (state.saveSTD = dcopy(OLDSTD, -1), 1); in execash()
593 lshift(kp->t_dcom, 1); in execash()
595 (void)close_on_exec (SHIN = dcopy(0, -1), 1); in execash()
596 (void)close_on_exec (SHOUT = dcopy(1, -1), 1); in execash()
597 (void)close_on_exec (SHDIAG = dcopy(2, -1), 1); in execash()
608 shlvl(-1); in execash()
671 for (pv = v->vec; pv && *pv; pv++, hashwidth++) in dohash()
697 for (pv = v->vec; pv && *pv; pv++, i++) { in dohash()
705 * non-dirs */ in dohash()
706 if (fstat(dirp->dd_fd, &stb) < 0 || !S_ISDIR(stb.st_mode)) { in dohash()
715 if (dp->d_ino == 0) in dohash()
717 if (dp->d_name[0] == '.' && in dohash()
718 (dp->d_name[1] == '\0' || in dohash()
719 (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) in dohash()
722 nt_check_name_and_hash(is_windir, dp->d_name, i); in dohash()
725 /* Turn foo.{exe,com,bat} into foo since UWIN's readdir returns in dohash()
726 * the file with the .exe, .com, .bat extension in dohash()
731 ssize_t ext = strlen(dp->d_name) - 4; in dohash()
732 if ((ext > 0) && (strcasecmp(&dp->d_name[ext], ".exe") == 0 || in dohash()
734 strcasecmp(&dp->d_name[ext], ".bat") == 0 || in dohash()
736 strcasecmp(&dp->d_name[ext], ".com") == 0)) { in dohash()
739 hashval = hashname(str2short(dp->d_name)); in dohash()
742 dp->d_name[ext] = '\0'; in dohash()
747 hashval = hashname(str2short(dp->d_name)); in dohash()
750 xprintf(CGETS(13, 1, "hash=%-4d dir=%-2d prog=%s\n"), in dohash()
751 hashname(str2short(dp->d_name)), i, dp->d_name); in dohash()
753 hashval = hash(hashname(str2short(dp->d_name)), i); in dohash()
756 /* tw_add_comm_name (dp->d_name); */ in dohash()
820 if (v == NULL || v->vec == NULL || v->vec[0] == NULL || slash) in iscommand()
823 opv = v->vec; in iscommand()
869 * I S A GmbH - Informationssysteme fuer computerintegrierte Automatisierung
871 * D-7000 Stuttgart 1
872 * West-Germany
900 return (stat(strname, &stbuf) != -1 && in executable()
921 *state->dest = state->val; in tellmewhat_s0_cleanup()
930 struct wordent *sp = lexp->next; in tellmewhat()
935 if (adrof1(sp->word, &aliases)) { in tellmewhat()
937 sp = lexp->next; in tellmewhat()
941 s0.dest = &sp->word; /* to get the memory freeing right... */ in tellmewhat()
942 s0.val = sp->word; in tellmewhat()
946 if ((*(sp->word) & (QUOTE | TRIM)) == QUOTE) in tellmewhat()
947 (sp->word)++; in tellmewhat()
950 s1 = s2 = sp->word; in tellmewhat()
971 if (eq(sp->word, str2short(bptr->bname))) { in tellmewhat()
975 xprintf(CGETS(13, 5, "%S: shell built-in command.\n"), in tellmewhat()
976 sp->word); in tellmewhat()
980 *str = Strsave(sp->word); in tellmewhat()
987 if (eq(sp->word, str2short(bptr->bname))) { in tellmewhat()
991 xprintf(CGETS(13, 5, "%S: shell built-in command.\n"), in tellmewhat()
992 sp->word); in tellmewhat()
996 *str = Strsave(sp->word); in tellmewhat()
1003 sp->word = cmd = globone(sp->word, G_IGNORE); in tellmewhat()
1006 if ((i = iscommand(sp->word)) != 0) { in tellmewhat()
1009 int slash = any(short2str(sp->word), '/'); in tellmewhat()
1012 if (v == NULL || v->vec == NULL || v->vec[0] == NULL || slash) in tellmewhat()
1015 pv = v->vec; in tellmewhat()
1017 pv += i - 1; in tellmewhat()
1020 sp->word = Strspl(STRdotsl, sp->word); in tellmewhat()
1021 cleanup_push(sp->word, xfree); in tellmewhat()
1023 cleanup_until(sp->word); in tellmewhat()
1030 sp->word = Strspl(s1, sp->word); in tellmewhat()
1032 cleanup_push(sp->word, xfree); in tellmewhat()
1036 *str = Strsave(sp->word); in tellmewhat()
1037 cleanup_until(sp->word); in tellmewhat()
1045 xprintf(CGETS(13, 6, "%S: Command not found.\n"), sp->word); in tellmewhat()
1049 *str = Strsave(sp->word); in tellmewhat()
1099 if (var->vec != NULL) in find_cmd()
1100 blkpr(var->vec); in find_cmd()
1109 if (eq(cmd, str2short(bptr->bname))) { in find_cmd()
1112 xprintf(CGETS(13, 9, "%S is a shell built-in\n"), cmd); in find_cmd()
1119 if (eq(cmd, str2short(bptr->bname))) { in find_cmd()
1122 xprintf(CGETS(13, 9, "%S is a shell built-in\n"), cmd); in find_cmd()
1141 for (pv = var->vec, i = 0; pv && *pv; pv++, i++) { in find_cmd()