(adapted changes from the tcsh source)
SCCS-vsn: bin/csh/exec.c 8.3
-static char sccsid[] = "@(#)exec.c 8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)exec.c 8.3 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
register struct biltins *bptr;
register struct wordent *sp = lex->next;
bool aliased = 0;
register struct biltins *bptr;
register struct wordent *sp = lex->next;
bool aliased = 0;
+ Char *s0, *s1, *s2, *cmd;
Char qc;
if (adrof1(sp->word, &aliases)) {
Char qc;
if (adrof1(sp->word, &aliases)) {
+ sp->word = cmd = globone(sp->word, G_IGNORE);
+
if ((i = iscommand(strip(sp->word))) != 0) {
register Char **pv;
register struct varent *v;
if ((i = iscommand(strip(sp->word))) != 0) {
register Char **pv;
register struct varent *v;
while (--i)
pv++;
if (pv[0][0] == 0 || eq(pv[0], STRdot)) {
while (--i)
pv++;
if (pv[0][0] == 0 || eq(pv[0], STRdot)) {
- sp->word = Strspl(STRdotsl, sp->word);
- prlex(cshout, lex);
- xfree((ptr_t) sp->word);
+ if (!slash) {
+ sp->word = Strspl(STRdotsl, sp->word);
+ prlex(cshout, lex);
+ xfree((ptr_t) sp->word);
+ }
+ else
+ prlex(cshout, lex);
sp->word = s0; /* we save and then restore this */
sp->word = s0; /* we save and then restore this */
return;
}
s1 = Strspl(*pv, STRslash);
return;
}
s1 = Strspl(*pv, STRslash);
(void) fprintf(csherr, "%s: Command not found.\n", vis_str(sp->word));
}
sp->word = s0; /* we save and then restore this */
(void) fprintf(csherr, "%s: Command not found.\n", vis_str(sp->word));
}
sp->word = s0; /* we save and then restore this */