tcsh: update to version 6.22.04.
Merge commit '174d8b60324d7e8754709f7155e13ca95220b48c' into main. MFC After: 2 weeks
This commit is contained in:
commit
6560ac57ce
@ -1,3 +1,4 @@
|
|||||||
|
15. V6.22.04 - 20210426
|
||||||
14. Don't crash with 'bindkey "^0" clear-screen' (Karl Jeacle)
|
14. Don't crash with 'bindkey "^0" clear-screen' (Karl Jeacle)
|
||||||
13. Fix $x:q:h and $x:q:t return the whole string for strings not containing /
|
13. Fix $x:q:h and $x:q:t return the whole string for strings not containing /
|
||||||
12. V6.22.03 - 20201118
|
12. V6.22.03 - 20201118
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
hello world
|
hello world
|
||||||
# echo "h<press key bound to dabbrev-expande>
|
# echo "h<press key bound to dabbrev-expande>
|
||||||
# echo "hello<cursor>
|
# echo "hello<cursor>
|
||||||
|
|
||||||
The former problem could be solved with minor modifications of c_preword()
|
The former problem could be solved with minor modifications of c_preword()
|
||||||
and c_endword(). The latter, however, required a significant rewrite of
|
and c_endword(). The latter, however, required a significant rewrite of
|
||||||
c_preword(), since quoted strings must be parsed from start to end to
|
c_preword(), since quoted strings must be parsed from start to end to
|
||||||
@ -207,9 +207,9 @@ c_delafter(int num)
|
|||||||
}
|
}
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
* XXX: We don't want to do that. In emacs mode overwrite should be
|
* XXX: We don't want to do that. In emacs mode overwrite should be
|
||||||
* sticky. I am not sure how that affects vi mode
|
* sticky. I am not sure how that affects vi mode
|
||||||
*/
|
*/
|
||||||
inputmode = MODE_INSERT;
|
inputmode = MODE_INSERT;
|
||||||
}
|
}
|
||||||
@ -269,7 +269,7 @@ c_preword(Char *p, Char *low, int n, Char *delim)
|
|||||||
new = c_endword(prev-1, p, 1, delim); /* Skip to next non-word char */
|
new = c_endword(prev-1, p, 1, delim); /* Skip to next non-word char */
|
||||||
new++; /* Step away from end of word */
|
new++; /* Step away from end of word */
|
||||||
while (new <= p) { /* Skip trailing non-word chars */
|
while (new <= p) { /* Skip trailing non-word chars */
|
||||||
if (!Strchr(delim, *new) || new > prev && new[-1] == (Char)'\\')
|
if (!Strchr(delim, *new) || (new > prev && new[-1] == (Char)'\\'))
|
||||||
break;
|
break;
|
||||||
new++;
|
new++;
|
||||||
}
|
}
|
||||||
@ -314,12 +314,12 @@ c_prev_word(Char *p, Char *low, int n)
|
|||||||
|
|
||||||
if (!VImode) {
|
if (!VImode) {
|
||||||
while (n--) {
|
while (n--) {
|
||||||
while ((p >= low) && !isword(*p))
|
while ((p >= low) && !isword(*p))
|
||||||
p--;
|
p--;
|
||||||
while ((p >= low) && isword(*p))
|
while ((p >= low) && isword(*p))
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cp now points to one character before the word */
|
/* cp now points to one character before the word */
|
||||||
p++;
|
p++;
|
||||||
if (p < low)
|
if (p < low)
|
||||||
@ -327,7 +327,7 @@ c_prev_word(Char *p, Char *low, int n)
|
|||||||
/* cp now points where we want it */
|
/* cp now points where we want it */
|
||||||
return(p);
|
return(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (n--) {
|
while (n--) {
|
||||||
int c_class;
|
int c_class;
|
||||||
|
|
||||||
@ -359,9 +359,9 @@ c_next_word(Char *p, Char *high, int n)
|
|||||||
{
|
{
|
||||||
if (!VImode) {
|
if (!VImode) {
|
||||||
while (n--) {
|
while (n--) {
|
||||||
while ((p < high) && !isword(*p))
|
while ((p < high) && !isword(*p))
|
||||||
p++;
|
p++;
|
||||||
while ((p < high) && isword(*p))
|
while ((p < high) && isword(*p))
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
if (p > high)
|
if (p > high)
|
||||||
@ -399,9 +399,9 @@ static Char *
|
|||||||
c_nexword(Char *p, Char *high, int n)
|
c_nexword(Char *p, Char *high, int n)
|
||||||
{
|
{
|
||||||
while (n--) {
|
while (n--) {
|
||||||
while ((p < high) && !Isspace(*p))
|
while ((p < high) && !Isspace(*p))
|
||||||
p++;
|
p++;
|
||||||
while ((p < high) && Isspace(*p))
|
while ((p < high) && Isspace(*p))
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,7 +507,7 @@ c_expand(Char *p)
|
|||||||
* Search for a space, tab, or colon. See if we have a number (as
|
* Search for a space, tab, or colon. See if we have a number (as
|
||||||
* in !1234:xyz). Remember the number.
|
* in !1234:xyz). Remember the number.
|
||||||
*/
|
*/
|
||||||
for (i = 0, all_dig = 1;
|
for (i = 0, all_dig = 1;
|
||||||
*q != ' ' && *q != '\t' && *q != ':' && q < Cursor; q++) {
|
*q != ' ' && *q != '\t' && *q != ':' && q < Cursor; q++) {
|
||||||
/*
|
/*
|
||||||
* PWP: !-4 is a valid history argument too, therefore the test
|
* PWP: !-4 is a valid history argument too, therefore the test
|
||||||
@ -739,7 +739,7 @@ c_substitute(void)
|
|||||||
* Start p out one character before the cursor. Move it backwards looking
|
* Start p out one character before the cursor. Move it backwards looking
|
||||||
* for white space, the beginning of the line, or a history character.
|
* for white space, the beginning of the line, or a history character.
|
||||||
*/
|
*/
|
||||||
for (p = Cursor - 1;
|
for (p = Cursor - 1;
|
||||||
p > InputBuf && *p != ' ' && *p != '\t' && *p && *p != HIST; --p)
|
p > InputBuf && *p != ' ' && *p != '\t' && *p && *p != HIST; --p)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -765,14 +765,14 @@ c_delfini(void) /* Finish up delete action */
|
|||||||
|
|
||||||
ActionFlag = TCSHOP_NOP;
|
ActionFlag = TCSHOP_NOP;
|
||||||
|
|
||||||
if (ActionPos == 0)
|
if (ActionPos == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UndoAction = TCSHOP_INSERT;
|
UndoAction = TCSHOP_INSERT;
|
||||||
|
|
||||||
if (Cursor > ActionPos) {
|
if (Cursor > ActionPos) {
|
||||||
Size = (int) (Cursor-ActionPos);
|
Size = (int) (Cursor-ActionPos);
|
||||||
c_delbefore(Size);
|
c_delbefore(Size);
|
||||||
RefCursor();
|
RefCursor();
|
||||||
}
|
}
|
||||||
else if (Cursor < ActionPos) {
|
else if (Cursor < ActionPos) {
|
||||||
@ -1016,7 +1016,7 @@ GetHistLine(void)
|
|||||||
if (LastChar < InputBuf)
|
if (LastChar < InputBuf)
|
||||||
LastChar = InputBuf;
|
LastChar = InputBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KSHVI
|
#ifdef KSHVI
|
||||||
if (VImode)
|
if (VImode)
|
||||||
Cursor = InputBuf;
|
Cursor = InputBuf;
|
||||||
@ -1082,7 +1082,7 @@ e_inc_search(int dir)
|
|||||||
}
|
}
|
||||||
done = redo = 0;
|
done = redo = 0;
|
||||||
*LastChar++ = '\n';
|
*LastChar++ = '\n';
|
||||||
for (cp = newdir == F_UP_SEARCH_HIST ? STRbck : STRfwd;
|
for (cp = newdir == F_UP_SEARCH_HIST ? STRbck : STRfwd;
|
||||||
*cp; *LastChar++ = *cp++)
|
*cp; *LastChar++ = *cp++)
|
||||||
continue;
|
continue;
|
||||||
*LastChar++ = pchar;
|
*LastChar++ = pchar;
|
||||||
@ -1128,7 +1128,7 @@ e_inc_search(int dir)
|
|||||||
case F_DELPREV:
|
case F_DELPREV:
|
||||||
if (patbuf.len > 1)
|
if (patbuf.len > 1)
|
||||||
done++;
|
done++;
|
||||||
else
|
else
|
||||||
SoundBeep();
|
SoundBeep();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1162,7 +1162,7 @@ e_inc_search(int dir)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* Terminate and execute cmd */
|
default: /* Terminate and execute cmd */
|
||||||
endcmd[0] = ch;
|
endcmd[0] = ch;
|
||||||
PushMacro(endcmd);
|
PushMacro(endcmd);
|
||||||
@ -1253,7 +1253,7 @@ e_inc_search(int dir)
|
|||||||
}
|
}
|
||||||
if (done || ret != CC_NORM)
|
if (done || ret != CC_NORM)
|
||||||
return(ret);
|
return(ret);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1359,7 +1359,7 @@ v_search(int dir)
|
|||||||
cleanup_until(&tmpbuf);
|
cleanup_until(&tmpbuf);
|
||||||
LastCmd = (KEYCMD) dir; /* avoid c_hsetpat */
|
LastCmd = (KEYCMD) dir; /* avoid c_hsetpat */
|
||||||
Cursor = LastChar = InputBuf;
|
Cursor = LastChar = InputBuf;
|
||||||
if ((dir == F_UP_SEARCH_HIST ? e_up_search_hist(0) :
|
if ((dir == F_UP_SEARCH_HIST ? e_up_search_hist(0) :
|
||||||
e_down_search_hist(0)) == CC_ERROR) {
|
e_down_search_hist(0)) == CC_ERROR) {
|
||||||
Refresh();
|
Refresh();
|
||||||
return(CC_ERROR);
|
return(CC_ERROR);
|
||||||
@ -1472,7 +1472,7 @@ e_insert(Char c)
|
|||||||
else {
|
else {
|
||||||
if (inputmode != MODE_INSERT) {
|
if (inputmode != MODE_INSERT) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < Argument; i++)
|
for (i = 0; i < Argument; i++)
|
||||||
UndoBuf[UndoSize++] = Cursor[i];
|
UndoBuf[UndoSize++] = Cursor[i];
|
||||||
|
|
||||||
UndoBuf[UndoSize] = '\0';
|
UndoBuf[UndoSize] = '\0';
|
||||||
@ -1948,7 +1948,7 @@ e_down_search_hist(Char c)
|
|||||||
#ifdef SDEBUG
|
#ifdef SDEBUG
|
||||||
xprintf("Comparing with \"%S\"\n", hl);
|
xprintf("Comparing with \"%S\"\n", hl);
|
||||||
#endif
|
#endif
|
||||||
if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) ||
|
if ((Strncmp(hl, InputBuf, (size_t) (LastChar - InputBuf)) ||
|
||||||
hl[LastChar-InputBuf]) && c_hmatch(hl))
|
hl[LastChar-InputBuf]) && c_hmatch(hl))
|
||||||
found = h;
|
found = h;
|
||||||
if (!HistLit)
|
if (!HistLit)
|
||||||
@ -2392,14 +2392,14 @@ e_delwordprev(Char c)
|
|||||||
* Changed the names of some of the ^D family of editor functions to
|
* Changed the names of some of the ^D family of editor functions to
|
||||||
* correspond to what they actually do and created new e_delnext_list
|
* correspond to what they actually do and created new e_delnext_list
|
||||||
* for completeness.
|
* for completeness.
|
||||||
*
|
*
|
||||||
* Old names: New names:
|
* Old names: New names:
|
||||||
*
|
*
|
||||||
* delete-char delete-char-or-eof
|
* delete-char delete-char-or-eof
|
||||||
* F_DELNEXT F_DELNEXT_EOF
|
* F_DELNEXT F_DELNEXT_EOF
|
||||||
* e_delnext e_delnext_eof
|
* e_delnext e_delnext_eof
|
||||||
* edelnxt edelnxteof
|
* edelnxt edelnxteof
|
||||||
* delete-char-or-eof delete-char
|
* delete-char-or-eof delete-char
|
||||||
* F_DELNEXT_EOF F_DELNEXT
|
* F_DELNEXT_EOF F_DELNEXT
|
||||||
* e_delnext_eof e_delnext
|
* e_delnext_eof e_delnext
|
||||||
* edelnxteof edelnxt
|
* edelnxteof edelnxt
|
||||||
@ -2445,13 +2445,13 @@ e_delnext_eof(Char c)
|
|||||||
USE(c);
|
USE(c);
|
||||||
if (Cursor == LastChar) {/* if I'm at the end */
|
if (Cursor == LastChar) {/* if I'm at the end */
|
||||||
if (!VImode) {
|
if (!VImode) {
|
||||||
if (Cursor == InputBuf) {
|
if (Cursor == InputBuf) {
|
||||||
/* if I'm also at the beginning */
|
/* if I'm also at the beginning */
|
||||||
so_write(STReof, 4);/* then do a EOF */
|
so_write(STReof, 4);/* then do a EOF */
|
||||||
flush();
|
flush();
|
||||||
return(CC_EOF);
|
return(CC_EOF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(CC_ERROR);
|
return(CC_ERROR);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2574,8 +2574,8 @@ e_tobeg(Char c)
|
|||||||
Cursor = InputBuf;
|
Cursor = InputBuf;
|
||||||
|
|
||||||
if (VImode) {
|
if (VImode) {
|
||||||
while (Isspace(*Cursor)) /* We want FIRST non space character */
|
while (Isspace(*Cursor)) /* We want FIRST non space character */
|
||||||
Cursor++;
|
Cursor++;
|
||||||
if (ActionFlag & TCSHOP_DELETE) {
|
if (ActionFlag & TCSHOP_DELETE) {
|
||||||
c_delfini();
|
c_delfini();
|
||||||
return(CC_REFRESH);
|
return(CC_REFRESH);
|
||||||
@ -2761,7 +2761,7 @@ e_wordback(Char c)
|
|||||||
|
|
||||||
Cursor = c_prev_word(Cursor, InputBuf, Argument); /* bounds check */
|
Cursor = c_prev_word(Cursor, InputBuf, Argument); /* bounds check */
|
||||||
|
|
||||||
if (VImode)
|
if (VImode)
|
||||||
if (ActionFlag & TCSHOP_DELETE) {
|
if (ActionFlag & TCSHOP_DELETE) {
|
||||||
c_delfini();
|
c_delfini();
|
||||||
return(CC_REFRESH);
|
return(CC_REFRESH);
|
||||||
@ -2892,9 +2892,9 @@ v_csearch_back(Char ch, int count, int tflag)
|
|||||||
|
|
||||||
cp = Cursor;
|
cp = Cursor;
|
||||||
while (count--) {
|
while (count--) {
|
||||||
if (*cp == ch)
|
if (*cp == ch)
|
||||||
cp--;
|
cp--;
|
||||||
while (cp > InputBuf && *cp != ch)
|
while (cp > InputBuf && *cp != ch)
|
||||||
cp--;
|
cp--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2923,9 +2923,9 @@ v_csearch_fwd(Char ch, int count, int tflag)
|
|||||||
|
|
||||||
cp = Cursor;
|
cp = Cursor;
|
||||||
while (count--) {
|
while (count--) {
|
||||||
if (*cp == ch)
|
if (*cp == ch)
|
||||||
cp++;
|
cp++;
|
||||||
while (cp < LastChar && *cp != ch)
|
while (cp < LastChar && *cp != ch)
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2955,21 +2955,21 @@ v_action(int c)
|
|||||||
if (ActionFlag == TCSHOP_DELETE) {
|
if (ActionFlag == TCSHOP_DELETE) {
|
||||||
ActionFlag = TCSHOP_NOP;
|
ActionFlag = TCSHOP_NOP;
|
||||||
ActionPos = 0;
|
ActionPos = 0;
|
||||||
|
|
||||||
UndoSize = 0;
|
UndoSize = 0;
|
||||||
kp = UndoBuf;
|
kp = UndoBuf;
|
||||||
for (cp = InputBuf; cp < LastChar; cp++) {
|
for (cp = InputBuf; cp < LastChar; cp++) {
|
||||||
*kp++ = *cp;
|
*kp++ = *cp;
|
||||||
UndoSize++;
|
UndoSize++;
|
||||||
}
|
}
|
||||||
|
|
||||||
UndoAction = TCSHOP_INSERT;
|
UndoAction = TCSHOP_INSERT;
|
||||||
UndoPtr = InputBuf;
|
UndoPtr = InputBuf;
|
||||||
LastChar = InputBuf;
|
LastChar = InputBuf;
|
||||||
Cursor = InputBuf;
|
Cursor = InputBuf;
|
||||||
if (c & TCSHOP_INSERT)
|
if (c & TCSHOP_INSERT)
|
||||||
c_alternativ_key_map(0);
|
c_alternativ_key_map(0);
|
||||||
|
|
||||||
return(CC_REFRESH);
|
return(CC_REFRESH);
|
||||||
}
|
}
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
@ -3359,7 +3359,7 @@ e_cleardisp(Char c)
|
|||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
CCRETVAL
|
CCRETVAL
|
||||||
e_tty_int(Char c)
|
e_tty_int(Char c)
|
||||||
{
|
{
|
||||||
USE(c);
|
USE(c);
|
||||||
#if defined(_MINIX) || defined(WINNT_NATIVE)
|
#if defined(_MINIX) || defined(WINNT_NATIVE)
|
||||||
/* SAK PATCH: erase all of current line, start again */
|
/* SAK PATCH: erase all of current line, start again */
|
||||||
@ -3398,9 +3398,9 @@ e_stuff_char(Char c)
|
|||||||
if (was_raw)
|
if (was_raw)
|
||||||
(void) Rawmode();
|
(void) Rawmode();
|
||||||
return(e_redisp(c));
|
return(e_redisp(c));
|
||||||
#else /* !TIOCSTI */
|
#else /* !TIOCSTI */
|
||||||
return(CC_ERROR);
|
return(CC_ERROR);
|
||||||
#endif /* !TIOCSTI */
|
#endif /* !TIOCSTI */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
@ -3538,7 +3538,7 @@ e_copyprev(Char c)
|
|||||||
|
|
||||||
oldc = Cursor;
|
oldc = Cursor;
|
||||||
/* does a bounds check */
|
/* does a bounds check */
|
||||||
cp = c_prev_word(Cursor, InputBuf, Argument);
|
cp = c_prev_word(Cursor, InputBuf, Argument);
|
||||||
|
|
||||||
c_insert((int)(oldc - cp));
|
c_insert((int)(oldc - cp));
|
||||||
for (dp = oldc; cp < oldc && dp < LastChar; cp++)
|
for (dp = oldc; cp < oldc && dp < LastChar; cp++)
|
||||||
@ -3569,7 +3569,7 @@ e_load_average(Char c)
|
|||||||
* Here we pass &c to the ioctl because some os's (NetBSD) expect it
|
* Here we pass &c to the ioctl because some os's (NetBSD) expect it
|
||||||
* there even if they don't use it. (lukem@netbsd.org)
|
* there even if they don't use it. (lukem@netbsd.org)
|
||||||
*/
|
*/
|
||||||
if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0)
|
if (ioctl(SHIN, TIOCSTAT, (ioctl_t) &c) < 0)
|
||||||
#endif
|
#endif
|
||||||
xprintf("%s", CGETS(5, 1, "Load average unavailable\n"));
|
xprintf("%s", CGETS(5, 1, "Load average unavailable\n"));
|
||||||
return(CC_REFRESH);
|
return(CC_REFRESH);
|
||||||
@ -3707,7 +3707,7 @@ v_rchar_fwd(Char c)
|
|||||||
if (srch_char == 0)
|
if (srch_char == 0)
|
||||||
return CC_ERROR;
|
return CC_ERROR;
|
||||||
|
|
||||||
return srch_dir == CHAR_FWD ? v_csearch_fwd(srch_char, Argument, 0) :
|
return srch_dir == CHAR_FWD ? v_csearch_fwd(srch_char, Argument, 0) :
|
||||||
v_csearch_back(srch_char, Argument, 0);
|
v_csearch_back(srch_char, Argument, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3719,7 +3719,7 @@ v_rchar_back(Char c)
|
|||||||
if (srch_char == 0)
|
if (srch_char == 0)
|
||||||
return CC_ERROR;
|
return CC_ERROR;
|
||||||
|
|
||||||
return srch_dir == CHAR_BACK ? v_csearch_fwd(srch_char, Argument, 0) :
|
return srch_dir == CHAR_BACK ? v_csearch_fwd(srch_char, Argument, 0) :
|
||||||
v_csearch_back(srch_char, Argument, 0);
|
v_csearch_back(srch_char, Argument, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3747,7 +3747,7 @@ v_undo(Char c)
|
|||||||
|
|
||||||
LastChar -= UndoSize;
|
LastChar -= UndoSize;
|
||||||
Cursor = UndoPtr;
|
Cursor = UndoPtr;
|
||||||
|
|
||||||
UndoAction = TCSHOP_INSERT;
|
UndoAction = TCSHOP_INSERT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3816,12 +3816,12 @@ v_rsrch_back(Char c)
|
|||||||
{
|
{
|
||||||
USE(c);
|
USE(c);
|
||||||
if (patbuf.len == 0) return(CC_ERROR);
|
if (patbuf.len == 0) return(CC_ERROR);
|
||||||
return(v_repeat_srch(searchdir == F_UP_SEARCH_HIST ?
|
return(v_repeat_srch(searchdir == F_UP_SEARCH_HIST ?
|
||||||
F_DOWN_SEARCH_HIST : F_UP_SEARCH_HIST));
|
F_DOWN_SEARCH_HIST : F_UP_SEARCH_HIST));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WINNT_NATIVE
|
#ifndef WINNT_NATIVE
|
||||||
/* Since ed.defns.h is generated from ed.defns.c, these empty
|
/* Since ed.defns.h is generated from ed.defns.c, these empty
|
||||||
functions will keep the F_NUM_FNS consistent
|
functions will keep the F_NUM_FNS consistent
|
||||||
*/
|
*/
|
||||||
CCRETVAL
|
CCRETVAL
|
||||||
|
@ -245,7 +245,7 @@ PFCmd CcFuncTbl[] = { /* table of available commands */
|
|||||||
#define F_PATH_NORM 103
|
#define F_PATH_NORM 103
|
||||||
e_delnext_eof, /* added by mtk@ari.ncl.omron.co.jp (920818) */
|
e_delnext_eof, /* added by mtk@ari.ncl.omron.co.jp (920818) */
|
||||||
#define F_DELNEXT_EOF 104
|
#define F_DELNEXT_EOF 104
|
||||||
e_stuff_char,
|
e_stuff_char,
|
||||||
#define F_STUFF_CHAR 105
|
#define F_STUFF_CHAR 105
|
||||||
e_complete_all,
|
e_complete_all,
|
||||||
#define F_COMPLETE_ALL 106
|
#define F_COMPLETE_ALL 106
|
||||||
@ -899,8 +899,8 @@ KEYCMD CcViCmdMap[] = {
|
|||||||
F_UNASSIGNED, /* ) */
|
F_UNASSIGNED, /* ) */
|
||||||
F_EXPAND_GLOB, /* * */
|
F_EXPAND_GLOB, /* * */
|
||||||
F_DOWN_HIST, /* + */
|
F_DOWN_HIST, /* + */
|
||||||
V_RCHAR_BACK, /* , */
|
V_RCHAR_BACK, /* , */
|
||||||
F_UP_HIST, /* - */
|
F_UP_HIST, /* - */
|
||||||
F_UNASSIGNED, /* . */
|
F_UNASSIGNED, /* . */
|
||||||
V_DSH_META, /* / */
|
V_DSH_META, /* / */
|
||||||
V_ZERO, /* 0 */
|
V_ZERO, /* 0 */
|
||||||
@ -1416,13 +1416,13 @@ editinit(void)
|
|||||||
f++;
|
f++;
|
||||||
f->name = "normalize-path";
|
f->name = "normalize-path";
|
||||||
f->func = F_PATH_NORM;
|
f->func = F_PATH_NORM;
|
||||||
f->desc = CSAVS(3, 53,
|
f->desc = CSAVS(3, 53,
|
||||||
"Expand pathnames, eliminating leading .'s and ..'s");
|
"Expand pathnames, eliminating leading .'s and ..'s");
|
||||||
|
|
||||||
f++;
|
f++;
|
||||||
f->name = "normalize-command";
|
f->name = "normalize-command";
|
||||||
f->func = F_COMMAND_NORM;
|
f->func = F_COMMAND_NORM;
|
||||||
f->desc = CSAVS(3, 54,
|
f->desc = CSAVS(3, 54,
|
||||||
"Expand commands to the resulting pathname or alias");
|
"Expand commands to the resulting pathname or alias");
|
||||||
|
|
||||||
f++;
|
f++;
|
||||||
|
@ -219,7 +219,7 @@ EXTERN char T_HasMeta; /* true if we have a meta key */
|
|||||||
# define M_CHAR 2
|
# define M_CHAR 2
|
||||||
# define M_NN 3
|
# define M_NN 3
|
||||||
#endif /* TERMIO */
|
#endif /* TERMIO */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *t_name;
|
const char *t_name;
|
||||||
unsigned int t_setmask;
|
unsigned int t_setmask;
|
||||||
unsigned int t_clrmask;
|
unsigned int t_clrmask;
|
||||||
@ -247,8 +247,12 @@ extern int tgetflag (const char *);
|
|||||||
extern int tgetnum (const char *);
|
extern int tgetnum (const char *);
|
||||||
extern char *tgoto (const char *, int, int);
|
extern char *tgoto (const char *, int, int);
|
||||||
extern void tputs (const char *, int, void (*)(int));
|
extern void tputs (const char *, int, void (*)(int));
|
||||||
# define PUTPURE ((void (*)(int)) putpure)
|
static __inline void PUTPURE(int c) {
|
||||||
# define PUTRAW ((void (*)(int)) putraw)
|
(void)putpure(c);
|
||||||
|
}
|
||||||
|
static __inline void PUTRAW(int c) {
|
||||||
|
(void)putraw(c);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _h_ed */
|
#endif /* _h_ed */
|
||||||
|
@ -41,7 +41,7 @@ int Tty_raw_mode = 0; /* Last tty change was to raw mode */
|
|||||||
int MacroLvl = -1; /* pointer to current macro nesting level; */
|
int MacroLvl = -1; /* pointer to current macro nesting level; */
|
||||||
/* (-1 == none) */
|
/* (-1 == none) */
|
||||||
static int Tty_quote_mode = 0; /* Last tty change was to quote mode */
|
static int Tty_quote_mode = 0; /* Last tty change was to quote mode */
|
||||||
static unsigned char vdisable; /* The value of _POSIX_VDISABLE from
|
static unsigned char vdisable; /* The value of _POSIX_VDISABLE from
|
||||||
* pathconf(2) */
|
* pathconf(2) */
|
||||||
|
|
||||||
int Tty_eight_bit = -1; /* does the tty handle eight bits */
|
int Tty_eight_bit = -1; /* does the tty handle eight bits */
|
||||||
@ -56,8 +56,8 @@ static ttydata_t extty, edtty, tstty;
|
|||||||
#define uc unsigned char
|
#define uc unsigned char
|
||||||
static unsigned char ttychars[NN_IO][C_NCC] = {
|
static unsigned char ttychars[NN_IO][C_NCC] = {
|
||||||
{
|
{
|
||||||
(uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL,
|
(uc)CINTR, (uc)CQUIT, (uc)CERASE, (uc)CKILL,
|
||||||
(uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH,
|
(uc)CEOF, (uc)CEOL, (uc)CEOL2, (uc)CSWTCH,
|
||||||
(uc)CDSWTCH, (uc)CERASE2, (uc)CSTART, (uc)CSTOP,
|
(uc)CDSWTCH, (uc)CERASE2, (uc)CSTART, (uc)CSTOP,
|
||||||
(uc)CWERASE, (uc)CSUSP, (uc)CDSUSP, (uc)CREPRINT,
|
(uc)CWERASE, (uc)CSUSP, (uc)CDSUSP, (uc)CREPRINT,
|
||||||
(uc)CDISCARD, (uc)CLNEXT, (uc)CSTATUS, (uc)CPAGE,
|
(uc)CDISCARD, (uc)CLNEXT, (uc)CSTATUS, (uc)CPAGE,
|
||||||
@ -65,15 +65,15 @@ static unsigned char ttychars[NN_IO][C_NCC] = {
|
|||||||
(uc)CTIME
|
(uc)CTIME
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
CINTR, CQUIT, CERASE, CKILL,
|
CINTR, CQUIT, CERASE, CKILL,
|
||||||
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||||
_POSIX_VDISABLE, CERASE2, CSTART, CSTOP,
|
_POSIX_VDISABLE, CERASE2, CSTART, CSTOP,
|
||||||
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||||
CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
CDISCARD, _POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE,
|
||||||
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1,
|
_POSIX_VDISABLE, _POSIX_VDISABLE, _POSIX_VDISABLE, 1,
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
@ -136,7 +136,7 @@ ed_set_tty_eight_bit(void)
|
|||||||
Tty_eight_bit = tty_geteightbit(&extty);
|
Tty_eight_bit = tty_geteightbit(&extty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ed_Setup(int rst)
|
ed_Setup(int rst)
|
||||||
{
|
{
|
||||||
@ -148,12 +148,12 @@ ed_Setup(int rst)
|
|||||||
|
|
||||||
#if defined(POSIX) && defined(_PC_VDISABLE) && !defined(BSD4_4) && \
|
#if defined(POSIX) && defined(_PC_VDISABLE) && !defined(BSD4_4) && \
|
||||||
!defined(WINNT_NATIVE)
|
!defined(WINNT_NATIVE)
|
||||||
{
|
{
|
||||||
long pcret;
|
long pcret;
|
||||||
|
|
||||||
if ((pcret = fpathconf(SHTTY, _PC_VDISABLE)) == -1L)
|
if ((pcret = fpathconf(SHTTY, _PC_VDISABLE)) == -1L)
|
||||||
vdisable = (unsigned char) _POSIX_VDISABLE;
|
vdisable = (unsigned char) _POSIX_VDISABLE;
|
||||||
else
|
else
|
||||||
vdisable = (unsigned char) pcret;
|
vdisable = (unsigned char) pcret;
|
||||||
if (vdisable != (unsigned char) _POSIX_VDISABLE && rst != 0)
|
if (vdisable != (unsigned char) _POSIX_VDISABLE && rst != 0)
|
||||||
for (rst = 0; rst < C_NCC; rst++) {
|
for (rst = 0; rst < C_NCC; rst++) {
|
||||||
@ -166,7 +166,7 @@ ed_Setup(int rst)
|
|||||||
#else /* ! POSIX || !_PC_VDISABLE || BSD4_4 || WINNT_NATIVE */
|
#else /* ! POSIX || !_PC_VDISABLE || BSD4_4 || WINNT_NATIVE */
|
||||||
vdisable = (unsigned char) _POSIX_VDISABLE;
|
vdisable = (unsigned char) _POSIX_VDISABLE;
|
||||||
#endif /* POSIX && _PC_VDISABLE && !BSD4_4 && !WINNT_NATIVE */
|
#endif /* POSIX && _PC_VDISABLE && !BSD4_4 && !WINNT_NATIVE */
|
||||||
|
|
||||||
if ((imode = adrof(STRinputmode)) != NULL && imode->vec != NULL) {
|
if ((imode = adrof(STRinputmode)) != NULL && imode->vec != NULL) {
|
||||||
if (!Strcmp(*(imode->vec), STRinsert))
|
if (!Strcmp(*(imode->vec), STRinsert))
|
||||||
inputmode = MODE_INSERT;
|
inputmode = MODE_INSERT;
|
||||||
@ -236,11 +236,11 @@ ed_Setup(int rst)
|
|||||||
/*
|
/*
|
||||||
* Don't affect CMIN and CTIME for the editor mode
|
* Don't affect CMIN and CTIME for the editor mode
|
||||||
*/
|
*/
|
||||||
for (rst = 0; rst < C_NCC - 2; rst++)
|
for (rst = 0; rst < C_NCC - 2; rst++)
|
||||||
if (ttychars[TS_IO][rst] != vdisable &&
|
if (ttychars[TS_IO][rst] != vdisable &&
|
||||||
ttychars[ED_IO][rst] != vdisable)
|
ttychars[ED_IO][rst] != vdisable)
|
||||||
ttychars[ED_IO][rst] = ttychars[TS_IO][rst];
|
ttychars[ED_IO][rst] = ttychars[TS_IO][rst];
|
||||||
for (rst = 0; rst < C_NCC; rst++)
|
for (rst = 0; rst < C_NCC; rst++)
|
||||||
if (ttychars[TS_IO][rst] != vdisable &&
|
if (ttychars[TS_IO][rst] != vdisable &&
|
||||||
ttychars[EX_IO][rst] != vdisable)
|
ttychars[EX_IO][rst] != vdisable)
|
||||||
ttychars[EX_IO][rst] = ttychars[TS_IO][rst];
|
ttychars[EX_IO][rst] = ttychars[TS_IO][rst];
|
||||||
@ -303,7 +303,7 @@ ed_Init(void)
|
|||||||
|
|
||||||
#ifdef DEBUG_EDIT
|
#ifdef DEBUG_EDIT
|
||||||
CheckMaps(); /* do a little error checking on key maps */
|
CheckMaps(); /* do a little error checking on key maps */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ed_Setup(0) == -1)
|
if (ed_Setup(0) == -1)
|
||||||
return;
|
return;
|
||||||
@ -355,7 +355,7 @@ ed_Init(void)
|
|||||||
#endif /* WINNT_NATIVE */
|
#endif /* WINNT_NATIVE */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check and re-init the line. set the terminal into 1 char at a time mode.
|
* Check and re-init the line. set the terminal into 1 char at a time mode.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
@ -416,12 +416,12 @@ Rawmode(void)
|
|||||||
|
|
||||||
if (tty_cooked_mode(&tstty)) {
|
if (tty_cooked_mode(&tstty)) {
|
||||||
/*
|
/*
|
||||||
* re-test for some things here (like maybe the user typed
|
* re-test for some things here (like maybe the user typed
|
||||||
* "stty -tabs"
|
* "stty -tabs"
|
||||||
*/
|
*/
|
||||||
if (tty_gettabs(&tstty) == 0)
|
if (tty_gettabs(&tstty) == 0)
|
||||||
T_Tabs = 0;
|
T_Tabs = 0;
|
||||||
else
|
else
|
||||||
T_Tabs = CanWeTab();
|
T_Tabs = CanWeTab();
|
||||||
|
|
||||||
# if defined(POSIX) || defined(TERMIO)
|
# if defined(POSIX) || defined(TERMIO)
|
||||||
@ -466,7 +466,7 @@ Rawmode(void)
|
|||||||
|
|
||||||
if (T_Tabs) /* order of &= and |= is important to XTABS */
|
if (T_Tabs) /* order of &= and |= is important to XTABS */
|
||||||
extty.d_t.sg_flags &= ~XTABS;
|
extty.d_t.sg_flags &= ~XTABS;
|
||||||
else
|
else
|
||||||
extty.d_t.sg_flags |= XTABS;
|
extty.d_t.sg_flags |= XTABS;
|
||||||
|
|
||||||
extty.d_lb = tstty.d_lb;
|
extty.d_lb = tstty.d_lb;
|
||||||
@ -475,13 +475,13 @@ Rawmode(void)
|
|||||||
|
|
||||||
edtty.d_t.sg_flags = extty.d_t.sg_flags;
|
edtty.d_t.sg_flags = extty.d_t.sg_flags;
|
||||||
if (T_Tabs) { /* order of &= and |= is important to XTABS */
|
if (T_Tabs) { /* order of &= and |= is important to XTABS */
|
||||||
edtty.d_t.sg_flags &=
|
edtty.d_t.sg_flags &=
|
||||||
~(ttylist[ED_IO][M_CONTROL].t_clrmask|XTABS);
|
~(ttylist[ED_IO][M_CONTROL].t_clrmask|XTABS);
|
||||||
edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask;
|
edtty.d_t.sg_flags |= ttylist[ED_IO][M_CONTROL].t_setmask;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
|
edtty.d_t.sg_flags &= ~ttylist[ED_IO][M_CONTROL].t_clrmask;
|
||||||
edtty.d_t.sg_flags |=
|
edtty.d_t.sg_flags |=
|
||||||
(ttylist[ED_IO][M_CONTROL].t_setmask|XTABS);
|
(ttylist[ED_IO][M_CONTROL].t_setmask|XTABS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,7 +503,7 @@ Rawmode(void)
|
|||||||
for (i = 0; i < C_NCC; i++)
|
for (i = 0; i < C_NCC; i++)
|
||||||
if (ttychars[TS_IO][i] != ttychars[EX_IO][i])
|
if (ttychars[TS_IO][i] != ttychars[EX_IO][i])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i != C_NCC || didsetty) {
|
if (i != C_NCC || didsetty) {
|
||||||
didsetty = 0;
|
didsetty = 0;
|
||||||
/*
|
/*
|
||||||
@ -605,7 +605,7 @@ Load_input_line(void)
|
|||||||
#ifdef SUNOS4
|
#ifdef SUNOS4
|
||||||
long chrs = 0;
|
long chrs = 0;
|
||||||
#else /* !SUNOS4 */
|
#else /* !SUNOS4 */
|
||||||
/*
|
/*
|
||||||
* *Everyone* else has an int, but SunOS wants long!
|
* *Everyone* else has an int, but SunOS wants long!
|
||||||
* This breaks where int != long (alpha)
|
* This breaks where int != long (alpha)
|
||||||
*/
|
*/
|
||||||
|
@ -114,7 +114,7 @@ Inputl(void)
|
|||||||
# ifdef SUNOS4
|
# ifdef SUNOS4
|
||||||
long chrs = 0;
|
long chrs = 0;
|
||||||
# else /* !SUNOS4 */
|
# else /* !SUNOS4 */
|
||||||
/*
|
/*
|
||||||
* *Everyone* else has an int, but SunOS wants long!
|
* *Everyone* else has an int, but SunOS wants long!
|
||||||
* This breaks where int != long (alpha)
|
* This breaks where int != long (alpha)
|
||||||
*/
|
*/
|
||||||
@ -384,7 +384,7 @@ Inputl(void)
|
|||||||
}
|
}
|
||||||
if (InputBuf[curlen] && rotate) {
|
if (InputBuf[curlen] && rotate) {
|
||||||
newlen = (int) (LastChar - InputBuf);
|
newlen = (int) (LastChar - InputBuf);
|
||||||
for (idx = (int) (Cursor - InputBuf);
|
for (idx = (int) (Cursor - InputBuf);
|
||||||
idx <= newlen; idx++)
|
idx <= newlen; idx++)
|
||||||
InputBuf[idx - newlen + curlen] =
|
InputBuf[idx - newlen + curlen] =
|
||||||
InputBuf[idx];
|
InputBuf[idx];
|
||||||
@ -439,13 +439,13 @@ Inputl(void)
|
|||||||
else
|
else
|
||||||
SoundBeep();
|
SoundBeep();
|
||||||
/*
|
/*
|
||||||
* Addition by David C Lawrence <tale@pawl.rpi.edu>: If an
|
* Addition by David C Lawrence <tale@pawl.rpi.edu>: If an
|
||||||
* attempted completion is ambiguous, list the choices.
|
* attempted completion is ambiguous, list the choices.
|
||||||
* (PWP: this is the best feature addition to tcsh I have
|
* (PWP: this is the best feature addition to tcsh I have
|
||||||
* seen in many months.)
|
* seen in many months.)
|
||||||
*/
|
*/
|
||||||
if (autol && autol->vec != NULL &&
|
if (autol && autol->vec != NULL &&
|
||||||
(Strcmp(*(autol->vec), STRambiguous) != 0 ||
|
(Strcmp(*(autol->vec), STRambiguous) != 0 ||
|
||||||
expnum == Cursor - InputBuf)) {
|
expnum == Cursor - InputBuf)) {
|
||||||
if (adrof(STRhighlight) && MarkIsSet) {
|
if (adrof(STRhighlight) && MarkIsSet) {
|
||||||
/* clear highlighting before showing completions */
|
/* clear highlighting before showing completions */
|
||||||
@ -477,7 +477,7 @@ Inputl(void)
|
|||||||
case CC_LIST_ALL:
|
case CC_LIST_ALL:
|
||||||
if (InputBuf[curlen] && rotate) {
|
if (InputBuf[curlen] && rotate) {
|
||||||
newlen = (int) (LastChar - InputBuf);
|
newlen = (int) (LastChar - InputBuf);
|
||||||
for (idx = (int) (Cursor - InputBuf);
|
for (idx = (int) (Cursor - InputBuf);
|
||||||
idx <= newlen; idx++)
|
idx <= newlen; idx++)
|
||||||
InputBuf[idx - newlen + curlen] =
|
InputBuf[idx - newlen + curlen] =
|
||||||
InputBuf[idx];
|
InputBuf[idx];
|
||||||
@ -667,7 +667,7 @@ RunCommand(Char *str)
|
|||||||
int
|
int
|
||||||
GetCmdChar(Char ch)
|
GetCmdChar(Char ch)
|
||||||
{
|
{
|
||||||
#ifndef WINNT_NATIVE // We use more than 256 for various extended keys
|
#ifndef WINNT_NATIVE // We use more than 256 for various extended keys
|
||||||
wint_t c = ch & CHAR;
|
wint_t c = ch & CHAR;
|
||||||
#else
|
#else
|
||||||
wint_t c = ch;
|
wint_t c = ch;
|
||||||
@ -725,7 +725,7 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!AltKeyMap)
|
if (!AltKeyMap)
|
||||||
CurrentKeyMap = CcKeyMap;
|
CurrentKeyMap = CcKeyMap;
|
||||||
}
|
}
|
||||||
*cmdnum = cmd;
|
*cmdnum = cmd;
|
||||||
|
@ -76,7 +76,7 @@ dprintstr(char *str, const Char *f, const Char *t)
|
|||||||
#endif /* DEBUG_UPDATE */
|
#endif /* DEBUG_UPDATE */
|
||||||
|
|
||||||
/* reprintf():
|
/* reprintf():
|
||||||
* Print to $DEBUGTTY, so that we can test editing on one pty, and
|
* Print to $DEBUGTTY, so that we can test editing on one pty, and
|
||||||
* print debugging stuff on another. Don't interrupt the shell while
|
* print debugging stuff on another. Don't interrupt the shell while
|
||||||
* debugging cause you'll mangle up the file descriptors!
|
* debugging cause you'll mangle up the file descriptors!
|
||||||
*/
|
*/
|
||||||
@ -461,7 +461,7 @@ GotoBottom(void)
|
|||||||
MoveToLine(OldvcV);
|
MoveToLine(OldvcV);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
PastBottom(void)
|
PastBottom(void)
|
||||||
@ -602,7 +602,7 @@ update_line(Char *old, Char *new, int cur_line)
|
|||||||
*/
|
*/
|
||||||
o = Strend(o);
|
o = Strend(o);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove any trailing blanks off of the end, being careful not to
|
* Remove any trailing blanks off of the end, being careful not to
|
||||||
* back up past the beginning.
|
* back up past the beginning.
|
||||||
*/
|
*/
|
||||||
@ -628,7 +628,7 @@ update_line(Char *old, Char *new, int cur_line)
|
|||||||
}
|
}
|
||||||
ne = n;
|
ne = n;
|
||||||
*ne = (Char) 0;
|
*ne = (Char) 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if no diff, continue to next line of redraw
|
* if no diff, continue to next line of redraw
|
||||||
*/
|
*/
|
||||||
@ -824,14 +824,14 @@ update_line(Char *old, Char *new, int cur_line)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* at this point we have something like this:
|
* at this point we have something like this:
|
||||||
*
|
*
|
||||||
* /old /ofd /osb /ose /ols /oe
|
* /old /ofd /osb /ose /ols /oe
|
||||||
* v.....................v v..................v v........v
|
* v.....................v v..................v v........v
|
||||||
* eddie> Oh, my fredded gruntle-buggy is to me, as foo var lurgid as
|
* eddie> Oh, my fredded gruntle-buggy is to me, as foo var lurgid as
|
||||||
* eddie> Oh, my fredded quiux buggy is to me, as gruntle-lurgid as
|
* eddie> Oh, my fredded quiux buggy is to me, as gruntle-lurgid as
|
||||||
* ^.....................^ ^..................^ ^........^
|
* ^.....................^ ^..................^ ^........^
|
||||||
* \new \nfd \nsb \nse \nls \ne
|
* \new \nfd \nsb \nse \nls \ne
|
||||||
*
|
*
|
||||||
* fx is the difference in length between the the chars between nfd and
|
* fx is the difference in length between the the chars between nfd and
|
||||||
* nsb, and the chars between ofd and osb, and is thus the number of
|
* nsb, and the chars between ofd and osb, and is thus the number of
|
||||||
* characters to delete if < 0 (new is shorter than old, as above),
|
* characters to delete if < 0 (new is shorter than old, as above),
|
||||||
@ -1040,7 +1040,7 @@ update_line(Char *old, Char *new, int cur_line)
|
|||||||
#ifdef DEBUG_UPDATE
|
#ifdef DEBUG_UPDATE
|
||||||
reprintf("with stuff to keep at end\r\n");
|
reprintf("with stuff to keep at end\r\n");
|
||||||
#endif /* DEBUG_UPDATE */
|
#endif /* DEBUG_UPDATE */
|
||||||
/*
|
/*
|
||||||
* We have to recalculate fx here because we set it
|
* We have to recalculate fx here because we set it
|
||||||
* to zero above as a flag saying that we hadn't done
|
* to zero above as a flag saying that we hadn't done
|
||||||
* an early first insert.
|
* an early first insert.
|
||||||
|
@ -135,7 +135,7 @@ static const struct {
|
|||||||
#define T_fs 12
|
#define T_fs 12
|
||||||
#define T_ho 13
|
#define T_ho 13
|
||||||
#define T_ic 14
|
#define T_ic 14
|
||||||
#define T_im 15
|
#define T_im 15
|
||||||
#define T_ip 16
|
#define T_ip 16
|
||||||
#define T_kd 17
|
#define T_kd 17
|
||||||
#define T_kh 18
|
#define T_kh 18
|
||||||
@ -477,7 +477,7 @@ SetTC(char *what, char *how)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (tv->name != NULL) {
|
if (tv->name != NULL) {
|
||||||
if (tv == &tval[T_pt] || tv == &tval[T_km] ||
|
if (tv == &tval[T_pt] || tv == &tval[T_km] ||
|
||||||
tv == &tval[T_am] || tv == &tval[T_xn]) {
|
tv == &tval[T_am] || tv == &tval[T_xn]) {
|
||||||
if (strcmp(how, "yes") == 0)
|
if (strcmp(how, "yes") == 0)
|
||||||
tv->val = 1;
|
tv->val = 1;
|
||||||
@ -491,7 +491,7 @@ SetTC(char *what, char *how)
|
|||||||
T_HasMeta = Val(T_km);
|
T_HasMeta = Val(T_km);
|
||||||
T_Margin = Val(T_am) ? MARGIN_AUTO : 0;
|
T_Margin = Val(T_am) ? MARGIN_AUTO : 0;
|
||||||
T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0;
|
T_Margin |= Val(T_xn) ? MARGIN_MAGIC : 0;
|
||||||
if (tv == &tval[T_am] || tv == &tval[T_xn])
|
if (tv == &tval[T_am] || tv == &tval[T_xn])
|
||||||
ChangeSize(Val(T_li), Val(T_co));
|
ChangeSize(Val(T_li), Val(T_co));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -593,7 +593,7 @@ EchoTC(Char **v)
|
|||||||
goto end_flush;
|
goto end_flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to use our local definition first
|
* Try to use our local definition first
|
||||||
*/
|
*/
|
||||||
scap = NULL;
|
scap = NULL;
|
||||||
@ -894,8 +894,8 @@ BindArrowKeys(void)
|
|||||||
/*
|
/*
|
||||||
* Assign the arrow keys only if:
|
* Assign the arrow keys only if:
|
||||||
*
|
*
|
||||||
* 1. They are multi-character arrow keys and the user
|
* 1. They are multi-character arrow keys and the user
|
||||||
* has not re-assigned the leading character, or
|
* has not re-assigned the leading character, or
|
||||||
* has re-assigned the leading character to be F_XKEY
|
* has re-assigned the leading character to be F_XKEY
|
||||||
* 2. They are single arrow keys pointing to an unassigned key.
|
* 2. They are single arrow keys pointing to an unassigned key.
|
||||||
*/
|
*/
|
||||||
@ -1012,7 +1012,7 @@ CanWeTab(void)
|
|||||||
|
|
||||||
/* move to line <where> (first line == 0) as efficiently as possible; */
|
/* move to line <where> (first line == 0) as efficiently as possible; */
|
||||||
void
|
void
|
||||||
MoveToLine(int where)
|
MoveToLine(int where)
|
||||||
{
|
{
|
||||||
int del;
|
int del;
|
||||||
|
|
||||||
@ -1048,7 +1048,7 @@ MoveToLine(int where)
|
|||||||
del = 0;
|
del = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for ( ; del > 0; del--)
|
for ( ; del > 0; del--)
|
||||||
(void) putraw('\n');
|
(void) putraw('\n');
|
||||||
CursorH = 0; /* because the \n will become \r\n */
|
CursorH = 0; /* because the \n will become \r\n */
|
||||||
}
|
}
|
||||||
@ -1415,7 +1415,7 @@ GetTermCaps(void)
|
|||||||
ptr = getenv("TERM");
|
ptr = getenv("TERM");
|
||||||
|
|
||||||
#ifdef apollo
|
#ifdef apollo
|
||||||
/*
|
/*
|
||||||
* If we are on a pad, we pretend that we are dumb. Otherwise the termcap
|
* If we are on a pad, we pretend that we are dumb. Otherwise the termcap
|
||||||
* library will put us in a weird screen mode, thinking that we are going
|
* library will put us in a weird screen mode, thinking that we are going
|
||||||
* to use curses
|
* to use curses
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "ed.h"
|
#include "ed.h"
|
||||||
|
|
||||||
int didsetty = 0;
|
int didsetty = 0;
|
||||||
ttyperm_t ttylist = {
|
ttyperm_t ttylist = {
|
||||||
{
|
{
|
||||||
#if defined(POSIX) || defined(TERMIO)
|
#if defined(POSIX) || defined(TERMIO)
|
||||||
{ "iflag:", ICRNL, (INLCR|IGNCR) },
|
{ "iflag:", ICRNL, (INLCR|IGNCR) },
|
||||||
@ -64,7 +64,7 @@ ttyperm_t ttylist = {
|
|||||||
{ "chars:", (C_SH(C_MIN)|C_SH(C_TIME)|C_SH(C_SWTCH)|C_SH(C_DSWTCH)|
|
{ "chars:", (C_SH(C_MIN)|C_SH(C_TIME)|C_SH(C_SWTCH)|C_SH(C_DSWTCH)|
|
||||||
C_SH(C_WERASE)|C_SH(C_REPRINT)|C_SH(C_SUSP)|C_SH(C_DSUSP)|
|
C_SH(C_WERASE)|C_SH(C_REPRINT)|C_SH(C_SUSP)|C_SH(C_DSUSP)|
|
||||||
C_SH(C_EOF)|C_SH(C_EOL)|C_SH(C_DISCARD)|C_SH(C_PGOFF)|
|
C_SH(C_EOF)|C_SH(C_EOL)|C_SH(C_DISCARD)|C_SH(C_PGOFF)|
|
||||||
C_SH(C_KILL2)|C_SH(C_PAGE)|C_SH(C_STATUS)|C_SH(C_LNEXT)),
|
C_SH(C_KILL2)|C_SH(C_PAGE)|C_SH(C_STATUS)|C_SH(C_LNEXT)),
|
||||||
0 }
|
0 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -317,7 +317,7 @@ static const struct tcshmodes {
|
|||||||
# endif /* LCASE */
|
# endif /* LCASE */
|
||||||
# ifdef ECHO
|
# ifdef ECHO
|
||||||
{ "echo", ECHO, M_CONTROL },
|
{ "echo", ECHO, M_CONTROL },
|
||||||
# endif /* ECHO */
|
# endif /* ECHO */
|
||||||
# ifdef CRMOD
|
# ifdef CRMOD
|
||||||
{ "crmod", CRMOD, M_CONTROL },
|
{ "crmod", CRMOD, M_CONTROL },
|
||||||
# endif /* CRMOD */
|
# endif /* CRMOD */
|
||||||
@ -432,7 +432,7 @@ static const struct tcshmodes {
|
|||||||
# endif /* LCRTKIL */
|
# endif /* LCRTKIL */
|
||||||
# ifdef LPASS8
|
# ifdef LPASS8
|
||||||
{ "lpass8", LPASS8, M_LOCAL },
|
{ "lpass8", LPASS8, M_LOCAL },
|
||||||
# endif /* LPASS8 */
|
# endif /* LPASS8 */
|
||||||
# ifdef LCTLECH
|
# ifdef LCTLECH
|
||||||
{ "lctlech",LCTLECH,M_LOCAL },
|
{ "lctlech",LCTLECH,M_LOCAL },
|
||||||
# endif /* LCTLECH */
|
# endif /* LCTLECH */
|
||||||
@ -510,7 +510,7 @@ static const struct tcshmodes {
|
|||||||
# if defined(VPGOFF) || defined(TIOCGPAGE)
|
# if defined(VPGOFF) || defined(TIOCGPAGE)
|
||||||
{ "pgoff", C_SH(C_PGOFF), M_CHAR },
|
{ "pgoff", C_SH(C_PGOFF), M_CHAR },
|
||||||
# endif /* VPGOFF */
|
# endif /* VPGOFF */
|
||||||
# if defined(VKILL2)
|
# if defined(VKILL2)
|
||||||
{ "kill2", C_SH(C_KILL2), M_CHAR },
|
{ "kill2", C_SH(C_KILL2), M_CHAR },
|
||||||
# endif /* VKILL2 */
|
# endif /* VKILL2 */
|
||||||
# if defined(VBRK) || defined(TIOCGETC)
|
# if defined(VBRK) || defined(TIOCGETC)
|
||||||
@ -528,7 +528,7 @@ static const struct tcshmodes {
|
|||||||
/*
|
/*
|
||||||
* If EAGAIN and/or EWOULDBLOCK are defined, we can't just return -1 in all
|
* If EAGAIN and/or EWOULDBLOCK are defined, we can't just return -1 in all
|
||||||
* situations where ioctl() does.
|
* situations where ioctl() does.
|
||||||
*
|
*
|
||||||
* On AIX 4.1.5 (and presumably some other versions and OSes), as you
|
* On AIX 4.1.5 (and presumably some other versions and OSes), as you
|
||||||
* perform the manual test suite in the README, if you 'bg' vi immediately
|
* perform the manual test suite in the README, if you 'bg' vi immediately
|
||||||
* after suspending it, all is well, but if you wait a few seconds,
|
* after suspending it, all is well, but if you wait a few seconds,
|
||||||
@ -537,7 +537,7 @@ static const struct tcshmodes {
|
|||||||
* 0, causing bgetc() to return -1, causing readc() to set doneinp to 1,
|
* 0, causing bgetc() to return -1, causing readc() to set doneinp to 1,
|
||||||
* causing process() to break out of the main loop, causing tcsh to exit
|
* causing process() to break out of the main loop, causing tcsh to exit
|
||||||
* prematurely.
|
* prematurely.
|
||||||
*
|
*
|
||||||
* If ioctl()'s errno is EAGAIN/EWOULDBLOCK ("Resource temporarily
|
* If ioctl()'s errno is EAGAIN/EWOULDBLOCK ("Resource temporarily
|
||||||
* unavailable"), apparently the tty is being messed with by the OS and we
|
* unavailable"), apparently the tty is being messed with by the OS and we
|
||||||
* need to try again. In my testing, ioctl() was never called more than
|
* need to try again. In my testing, ioctl() was never called more than
|
||||||
@ -595,7 +595,7 @@ dosetty(Char **v, struct command *t)
|
|||||||
cleanup_push(cmdname, xfree);
|
cleanup_push(cmdname, xfree);
|
||||||
setname(cmdname);
|
setname(cmdname);
|
||||||
|
|
||||||
while (v && *v && v[0][0] == '-' && v[0][2] == '\0')
|
while (v && *v && v[0][0] == '-' && v[0][2] == '\0')
|
||||||
switch (v[0][1]) {
|
switch (v[0][1]) {
|
||||||
case 'a':
|
case 'a':
|
||||||
aflag++;
|
aflag++;
|
||||||
@ -641,7 +641,7 @@ dosetty(Char **v, struct command *t)
|
|||||||
xprintf("\n%*s", st, "");
|
xprintf("\n%*s", st, "");
|
||||||
len = st + cu;
|
len = st + cu;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
len += cu;
|
len += cu;
|
||||||
if (x != '\0')
|
if (x != '\0')
|
||||||
xprintf("%c%s ", x, m->m_name);
|
xprintf("%c%s ", x, m->m_name);
|
||||||
@ -667,7 +667,7 @@ dosetty(Char **v, struct command *t)
|
|||||||
for (m = modelist; m->m_name; m++)
|
for (m = modelist; m->m_name; m++)
|
||||||
if (strcmp(m->m_name, d) == 0)
|
if (strcmp(m->m_name, d) == 0)
|
||||||
break;
|
break;
|
||||||
if (!m->m_name)
|
if (!m->m_name)
|
||||||
stderror(ERR_NAME | ERR_SYSTEM, d, CGETS(8, 2, "Invalid argument"));
|
stderror(ERR_NAME | ERR_SYSTEM, d, CGETS(8, 2, "Invalid argument"));
|
||||||
|
|
||||||
switch (x) {
|
switch (x) {
|
||||||
@ -723,7 +723,7 @@ int
|
|||||||
tty_setty(int fd, ttydata_t *td)
|
tty_setty(int fd, ttydata_t *td)
|
||||||
{
|
{
|
||||||
#ifdef POSIX
|
#ifdef POSIX
|
||||||
RETRY(xtcsetattr(fd, TCSADRAIN, &td->d_t));
|
RETRY(xtcsetattr(fd, TCSADRAIN, &td->d_t));
|
||||||
#else
|
#else
|
||||||
# ifdef TERMIO
|
# ifdef TERMIO
|
||||||
RETRY(ioctl(fd, TCSETAW, (ioctl_t) &td->d_t));
|
RETRY(ioctl(fd, TCSETAW, (ioctl_t) &td->d_t));
|
||||||
@ -752,7 +752,7 @@ tty_setty(int fd, ttydata_t *td)
|
|||||||
|
|
||||||
void
|
void
|
||||||
tty_getchar(ttydata_t *td, unsigned char *s)
|
tty_getchar(ttydata_t *td, unsigned char *s)
|
||||||
{
|
{
|
||||||
#ifdef TIOCGLTC
|
#ifdef TIOCGLTC
|
||||||
{
|
{
|
||||||
struct ltchars *n = &td->d_ltc;
|
struct ltchars *n = &td->d_ltc;
|
||||||
@ -888,10 +888,10 @@ tty_getchar(ttydata_t *td, unsigned char *s)
|
|||||||
|
|
||||||
void
|
void
|
||||||
tty_setchar(ttydata_t *td, unsigned char *s)
|
tty_setchar(ttydata_t *td, unsigned char *s)
|
||||||
{
|
{
|
||||||
#ifdef TIOCGLTC
|
#ifdef TIOCGLTC
|
||||||
{
|
{
|
||||||
struct ltchars *n = &td->d_ltc;
|
struct ltchars *n = &td->d_ltc;
|
||||||
|
|
||||||
n->t_suspc = s[C_SUSP];
|
n->t_suspc = s[C_SUSP];
|
||||||
n->t_dsuspc = s[C_DSUSP];
|
n->t_dsuspc = s[C_DSUSP];
|
||||||
@ -1035,9 +1035,9 @@ tty_getspeed(ttydata_t *td)
|
|||||||
# ifdef TERMIO
|
# ifdef TERMIO
|
||||||
# ifdef CBAUD
|
# ifdef CBAUD
|
||||||
spd = td->d_t.c_cflag & CBAUD;
|
spd = td->d_t.c_cflag & CBAUD;
|
||||||
# else
|
# else
|
||||||
spd = 0;
|
spd = 0;
|
||||||
# endif
|
# endif
|
||||||
# else /* SGTTY */
|
# else /* SGTTY */
|
||||||
spd = td->d_t.sg_ispeed;
|
spd = td->d_t.sg_ispeed;
|
||||||
# endif /* TERMIO */
|
# endif /* TERMIO */
|
||||||
@ -1118,7 +1118,7 @@ tty_printchar(unsigned char *s)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < C_NCC; i++) {
|
for (i = 0; i < C_NCC; i++) {
|
||||||
for (m = modelist; m->m_name; m++)
|
for (m = modelist; m->m_name; m++)
|
||||||
if (m->m_type == M_CHAR && C_SH(i) == m->m_value)
|
if (m->m_type == M_CHAR && C_SH(i) == m->m_value)
|
||||||
break;
|
break;
|
||||||
if (m->m_name)
|
if (m->m_name)
|
||||||
|
@ -181,10 +181,10 @@
|
|||||||
# undef CKILL
|
# undef CKILL
|
||||||
# undef CEOF
|
# undef CEOF
|
||||||
# undef CEOL
|
# undef CEOL
|
||||||
# undef CEOL2
|
# undef CEOL2
|
||||||
# undef CSWTCH
|
# undef CSWTCH
|
||||||
# define CSWTCH TO_CONTROL('z')
|
# define CSWTCH TO_CONTROL('z')
|
||||||
# undef CDSWTCH
|
# undef CDSWTCH
|
||||||
# undef CERASE2
|
# undef CERASE2
|
||||||
# undef CSTART
|
# undef CSTART
|
||||||
# undef CSTOP
|
# undef CSTOP
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* Looks up *ch in map and then reads characters until a
|
* Looks up *ch in map and then reads characters until a
|
||||||
* complete match is found or a mismatch occurs. Returns the
|
* complete match is found or a mismatch occurs. Returns the
|
||||||
* type of the match found (XK_STR, XK_CMD, or XK_EXE).
|
* type of the match found (XK_STR, XK_CMD, or XK_EXE).
|
||||||
* Returns NULL in val.str and XK_STR for no match.
|
* Returns NULL in val.str and XK_STR for no match.
|
||||||
* The last character read is returned in *ch.
|
* The last character read is returned in *ch.
|
||||||
*
|
*
|
||||||
* void AddXkey(Xkey, val, ntype);
|
* void AddXkey(Xkey, val, ntype);
|
||||||
@ -227,7 +227,7 @@ AddXkey(const CStr *Xkey, XmapVal *val, int ntype)
|
|||||||
Xmap = GetFreeNode(&cs); /* it is properly initialized */
|
Xmap = GetFreeNode(&cs); /* it is properly initialized */
|
||||||
|
|
||||||
/* Now recurse through Xmap */
|
/* Now recurse through Xmap */
|
||||||
(void) TryNode(Xmap, &cs, val, ntype);
|
(void) TryNode(Xmap, &cs, val, ntype);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ GetFreeNode(CStr *ch)
|
|||||||
ptr->sibling = NULL;
|
ptr->sibling = NULL;
|
||||||
return (ptr);
|
return (ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* PrintXKey():
|
/* PrintXKey():
|
||||||
* Print the binding associated with Xkey key.
|
* Print the binding associated with Xkey key.
|
||||||
@ -560,7 +560,7 @@ printOne(const Char *key, const XmapVal *val, int ntype)
|
|||||||
for (fp = FuncNames; fp->name; fp++)
|
for (fp = FuncNames; fp->name; fp++)
|
||||||
if (val->cmd == fp->func)
|
if (val->cmd == fp->func)
|
||||||
xprintf(fmt, fp->name);
|
xprintf(fmt, fp->name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
break;
|
break;
|
||||||
@ -685,7 +685,7 @@ parseescape(const Char **ptr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((*p & CHAR) == '^' && (Isalpha(p[1] & CHAR) ||
|
else if ((*p & CHAR) == '^' && (Isalpha(p[1] & CHAR) ||
|
||||||
strchr("@^_?\\|[{]}", p[1] & CHAR))) {
|
strchr("@^_?\\|[{]}", p[1] & CHAR))) {
|
||||||
p++;
|
p++;
|
||||||
#ifdef IS_ASCII
|
#ifdef IS_ASCII
|
||||||
|
@ -49,10 +49,10 @@
|
|||||||
|
|
||||||
#define ISSPACE(p) (isspace((unsigned char) (p)) && (p) != '\n')
|
#define ISSPACE(p) (isspace((unsigned char) (p)) && (p) != '\n')
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We cannot do that, because some compilers like #line and others
|
* We cannot do that, because some compilers like #line and others
|
||||||
* like # <lineno>
|
* like # <lineno>
|
||||||
* #define LINEDIRECTIVE
|
* #define LINEDIRECTIVE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const char *keyword[] =
|
static const char *keyword[] =
|
||||||
@ -217,7 +217,7 @@ explode(const char *defs)
|
|||||||
buf = cat(buf, eptr + 1, 0);
|
buf = cat(buf, eptr + 1, 0);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
@ -357,7 +357,7 @@ main(int argc, char *argv[])
|
|||||||
(void) fprintf(stdout, "# if (%s) && !defined(_%s_)\n",
|
(void) fprintf(stdout, "# if (%s) && !defined(_%s_)\n",
|
||||||
explode(defs), keyword[token]);
|
explode(defs), keyword[token]);
|
||||||
else
|
else
|
||||||
(void) fprintf(stdout, "# if !defined(_%s_)\n",
|
(void) fprintf(stdout, "# if !defined(_%s_)\n",
|
||||||
keyword[token]);
|
keyword[token]);
|
||||||
|
|
||||||
if (gettoken(&ptr, stmt) == NULL) {
|
if (gettoken(&ptr, stmt) == NULL) {
|
||||||
|
@ -259,7 +259,7 @@ static void
|
|||||||
qprintf(const char *pre, const Char *s)
|
qprintf(const char *pre, const Char *s)
|
||||||
{
|
{
|
||||||
const Char *p;
|
const Char *p;
|
||||||
|
|
||||||
xprintf("%s", pre);
|
xprintf("%s", pre);
|
||||||
for (p = s; *p; p++)
|
for (p = s; *p; p++)
|
||||||
xprintf("%c", *p & 0xff);
|
xprintf("%c", *p & 0xff);
|
||||||
@ -334,7 +334,7 @@ glob(const char *pattern, int flags, int (*errfunc) (const char *, int),
|
|||||||
while ((c = *patnext++) != EOS) {
|
while ((c = *patnext++) != EOS) {
|
||||||
#ifdef WIDE_STRINGS
|
#ifdef WIDE_STRINGS
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = mblen((const char *)(patnext - 1), MB_LEN_MAX);
|
len = mblen((const char *)(patnext - 1), MB_LEN_MAX);
|
||||||
if (len == -1)
|
if (len == -1)
|
||||||
TCSH_IGNORE(mblen(NULL, 0));
|
TCSH_IGNORE(mblen(NULL, 0));
|
||||||
@ -401,7 +401,7 @@ glob(const char *pattern, int flags, int (*errfunc) (const char *, int),
|
|||||||
* to avoid exponential behavior
|
* to avoid exponential behavior
|
||||||
*/
|
*/
|
||||||
if (bufnext == patbuf || bufnext[-1] != M_ALL ||
|
if (bufnext == patbuf || bufnext[-1] != M_ALL ||
|
||||||
((flags & GLOB_STAR) != 0 &&
|
((flags & GLOB_STAR) != 0 &&
|
||||||
(bufnext - 1 == patbuf || bufnext[-2] != M_ALL ||
|
(bufnext - 1 == patbuf || bufnext[-2] != M_ALL ||
|
||||||
bufnext - 2 == patbuf || bufnext[-3] != M_ALL)))
|
bufnext - 2 == patbuf || bufnext[-3] != M_ALL)))
|
||||||
*bufnext++ = M_ALL;
|
*bufnext++ = M_ALL;
|
||||||
@ -422,13 +422,13 @@ glob(const char *pattern, int flags, int (*errfunc) (const char *, int),
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there was no match we are going to append the pattern
|
* If there was no match we are going to append the pattern
|
||||||
* if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
|
* if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
|
||||||
* and the pattern did not contain any magic characters
|
* and the pattern did not contain any magic characters
|
||||||
* GLOB_NOMAGIC is there just for compatibility with csh.
|
* GLOB_NOMAGIC is there just for compatibility with csh.
|
||||||
*/
|
*/
|
||||||
if (pglob->gl_pathc == oldpathc &&
|
if (pglob->gl_pathc == oldpathc &&
|
||||||
((flags & GLOB_NOCHECK) ||
|
((flags & GLOB_NOCHECK) ||
|
||||||
((flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) {
|
((flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) {
|
||||||
if (!(flags & GLOB_QUOTE))
|
if (!(flags & GLOB_QUOTE))
|
||||||
globextend(pattern, pglob);
|
globextend(pattern, pglob);
|
||||||
@ -559,7 +559,7 @@ One_Char_mbtowc(__Char *pwc, const Char *s, size_t n)
|
|||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
glob3(struct strbuf *pathbuf, const Char *pattern, const Char *restpattern,
|
glob3(struct strbuf *pathbuf, const Char *pattern, const Char *restpattern,
|
||||||
const Char *pglobstar, glob_t *pglob, int no_match)
|
const Char *pglobstar, glob_t *pglob, int no_match)
|
||||||
@ -589,7 +589,7 @@ glob3(struct strbuf *pathbuf, const Char *pattern, const Char *restpattern,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pglobstar += width;
|
pglobstar += width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (globstar) {
|
if (globstar) {
|
||||||
err = pglobstar==pattern && termstar==restpattern ?
|
err = pglobstar==pattern && termstar==restpattern ?
|
||||||
@ -637,7 +637,7 @@ glob3(struct strbuf *pathbuf, const Char *pattern, const Char *restpattern,
|
|||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
if (match(pathbuf->s + orig_len, pattern, termstar,
|
if (match(pathbuf->s + orig_len, pattern, termstar,
|
||||||
(int)m_not) == no_match)
|
(int)m_not) == no_match)
|
||||||
continue;
|
continue;
|
||||||
strbuf_append1(pathbuf, SEP);
|
strbuf_append1(pathbuf, SEP);
|
||||||
strbuf_terminate(pathbuf);
|
strbuf_terminate(pathbuf);
|
||||||
|
@ -78,7 +78,7 @@ typedef struct {
|
|||||||
#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
|
#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
|
||||||
#define GLOB_LIMIT 0x0400 /* Limit memory used by matches to ARG_MAX */
|
#define GLOB_LIMIT 0x0400 /* Limit memory used by matches to ARG_MAX */
|
||||||
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
|
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
|
||||||
#define GLOB_ALTNOT 0x1000 /* use alternate glob character [^ not !] */
|
#define GLOB_ALTNOT 0x1000 /* use alternate glob character [^ not !] */
|
||||||
#define GLOB_QUOTE 0x2000 /* XXX: source compatibility */
|
#define GLOB_QUOTE 0x2000 /* XXX: source compatibility */
|
||||||
#define GLOB_STAR 0x4000 /* use glob ** to recurse directories */
|
#define GLOB_STAR 0x4000 /* use glob ** to recurse directories */
|
||||||
#define GLOB_DOT 0x8000 /* don't skip dotfiles (except . and ..) */
|
#define GLOB_DOT 0x8000 /* don't skip dotfiles (except . and ..) */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1990 Carnegie Mellon University
|
* Copyright (c) 1990 Carnegie Mellon University
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify and distribute this software and its
|
* Permission to use, copy, modify and distribute this software and its
|
||||||
* documentation is hereby granted, provided that both the copyright
|
* documentation is hereby granted, provided that both the copyright
|
||||||
* notice and this permission notice appear in all copies of the
|
* notice and this permission notice appear in all copies of the
|
||||||
@ -69,7 +69,7 @@
|
|||||||
*
|
*
|
||||||
* Revision 1.4 90/12/11 17:58:44 mja
|
* Revision 1.4 90/12/11 17:58:44 mja
|
||||||
* Add copyright/disclaimer for distribution.
|
* Add copyright/disclaimer for distribution.
|
||||||
*
|
*
|
||||||
* 05-Jun-88 Glenn Marcy (gm0w) at Carnegie-Mellon University
|
* 05-Jun-88 Glenn Marcy (gm0w) at Carnegie-Mellon University
|
||||||
* Make all non-entry points static.
|
* Make all non-entry points static.
|
||||||
*
|
*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* termios.c - fake termios interface using sgtty interface
|
/* termios.c - fake termios interface using sgtty interface
|
||||||
* by Magnus Doell and Bruce Evans.
|
* by Magnus Doell and Bruce Evans.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* The <sys/wait.h> header contains macros related to wait(). The value
|
/* The <sys/wait.h> header contains macros related to wait(). The value
|
||||||
* returned by wait() and waitpid() depends on whether the process
|
* returned by wait() and waitpid() depends on whether the process
|
||||||
* terminated by an exit() call, was killed by a signal, or was stopped
|
* terminated by an exit() call, was killed by a signal, or was stopped
|
||||||
* due to job control, as follows:
|
* due to job control, as follows:
|
||||||
*
|
*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#define ORIGIN "Astron"
|
#define ORIGIN "Astron"
|
||||||
#define REV 6
|
#define REV 6
|
||||||
#define VERS 22
|
#define VERS 22
|
||||||
#define PATCHLEVEL 03
|
#define PATCHLEVEL 04
|
||||||
#define DATE "2020-11-18"
|
#define DATE "2021-04-26"
|
||||||
|
|
||||||
#endif /* _h_patchlevel */
|
#endif /* _h_patchlevel */
|
||||||
|
@ -276,7 +276,7 @@ main(int argc, char **argv)
|
|||||||
initlex(¶ml);
|
initlex(¶ml);
|
||||||
|
|
||||||
#ifdef MALLOC_TRACE
|
#ifdef MALLOC_TRACE
|
||||||
mal_setstatsfile(fdopen(dmove(xopen("/tmp/tcsh.trace",
|
mal_setstatsfile(fdopen(dmove(xopen("/tmp/tcsh.trace",
|
||||||
O_WRONLY|O_CREAT|O_LARGEFILE, 0666), 25), "w"));
|
O_WRONLY|O_CREAT|O_LARGEFILE, 0666), 25), "w"));
|
||||||
mal_trace(1);
|
mal_trace(1);
|
||||||
#endif /* MALLOC_TRACE */
|
#endif /* MALLOC_TRACE */
|
||||||
@ -303,9 +303,9 @@ main(int argc, char **argv)
|
|||||||
* Otherwise `` jobs will not work... (From knaff@poly.polytechnique.fr)
|
* Otherwise `` jobs will not work... (From knaff@poly.polytechnique.fr)
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
if ((f = xopen(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE)) == -1 &&
|
if ((f = xopen(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE)) == -1 &&
|
||||||
(f = xopen("/", O_RDONLY|O_LARGEFILE)) == -1)
|
(f = xopen("/", O_RDONLY|O_LARGEFILE)) == -1)
|
||||||
exit(1);
|
exit(1);
|
||||||
while (f < 3);
|
while (f < 3);
|
||||||
xclose(f);
|
xclose(f);
|
||||||
@ -313,7 +313,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
osinit(); /* Os dependent initialization */
|
osinit(); /* Os dependent initialization */
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
@ -512,24 +512,24 @@ main(int argc, char **argv)
|
|||||||
* on shells running as root. Out of these, autologout should NOT be set
|
* on shells running as root. Out of these, autologout should NOT be set
|
||||||
* for any psudo-terminals (this catches most window systems) and not for
|
* for any psudo-terminals (this catches most window systems) and not for
|
||||||
* any terminal running X windows.
|
* any terminal running X windows.
|
||||||
*
|
*
|
||||||
* At Ohio State, we have had problems with a user having his X session
|
* At Ohio State, we have had problems with a user having his X session
|
||||||
* drop out from under him (on a Sun) because the shell in his master
|
* drop out from under him (on a Sun) because the shell in his master
|
||||||
* xterm timed out and exited.
|
* xterm timed out and exited.
|
||||||
*
|
*
|
||||||
* Really, this should be done with a program external to the shell, that
|
* Really, this should be done with a program external to the shell, that
|
||||||
* watches for no activity (and NO running programs, such as dump) on a
|
* watches for no activity (and NO running programs, such as dump) on a
|
||||||
* terminal for a long peroid of time, and then SIGHUPS the shell on that
|
* terminal for a long peroid of time, and then SIGHUPS the shell on that
|
||||||
* terminal.
|
* terminal.
|
||||||
*
|
*
|
||||||
* bugfix by Rich Salz <rsalz@PINEAPPLE.BBN.COM>: For root rsh things
|
* bugfix by Rich Salz <rsalz@PINEAPPLE.BBN.COM>: For root rsh things
|
||||||
* allways first check to see if loginsh or really root, then do things
|
* allways first check to see if loginsh or really root, then do things
|
||||||
* with ttyname()
|
* with ttyname()
|
||||||
*
|
*
|
||||||
* Also by Jean-Francois Lamy <lamy%ai.toronto.edu@RELAY.CS.NET>: check the
|
* Also by Jean-Francois Lamy <lamy%ai.toronto.edu@RELAY.CS.NET>: check the
|
||||||
* value of cp before using it! ("root can rsh too")
|
* value of cp before using it! ("root can rsh too")
|
||||||
*
|
*
|
||||||
* PWP: keep the nested ifs; the order of the tests matters and a good
|
* PWP: keep the nested ifs; the order of the tests matters and a good
|
||||||
* (smart) C compiler might re-arange things wrong.
|
* (smart) C compiler might re-arange things wrong.
|
||||||
*/
|
*/
|
||||||
#ifdef AUTOLOGOUT
|
#ifdef AUTOLOGOUT
|
||||||
@ -662,7 +662,7 @@ main(int argc, char **argv)
|
|||||||
tsetenv(STRLOGNAME, varval(STRuser));
|
tsetenv(STRLOGNAME, varval(STRuser));
|
||||||
if (cus == NULL)
|
if (cus == NULL)
|
||||||
tsetenv(STRKUSER, varval(STRuser));
|
tsetenv(STRKUSER, varval(STRuser));
|
||||||
|
|
||||||
cgr = getenv("GROUP");
|
cgr = getenv("GROUP");
|
||||||
if (cgr != NULL)
|
if (cgr != NULL)
|
||||||
setv(STRgroup, quote(SAVE(cgr)), VAR_READWRITE);
|
setv(STRgroup, quote(SAVE(cgr)), VAR_READWRITE);
|
||||||
@ -696,7 +696,7 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
remotehost();
|
remotehost();
|
||||||
#endif /* REMOTEHOST */
|
#endif /* REMOTEHOST */
|
||||||
|
|
||||||
#ifdef apollo
|
#ifdef apollo
|
||||||
if ((tcp = getenv("SYSTYPE")) == NULL)
|
if ((tcp = getenv("SYSTYPE")) == NULL)
|
||||||
tcp = "bsd4.3";
|
tcp = "bsd4.3";
|
||||||
@ -710,14 +710,14 @@ main(int argc, char **argv)
|
|||||||
* should determine if we should edit or not. $TERM is preserved
|
* should determine if we should edit or not. $TERM is preserved
|
||||||
* across rlogin sessions, so we will not get confused if we rlogin
|
* across rlogin sessions, so we will not get confused if we rlogin
|
||||||
* under an emacs shell. Another advantage is that if we run an
|
* under an emacs shell. Another advantage is that if we run an
|
||||||
* xterm under an emacs shell, then the $TERM will be set to
|
* xterm under an emacs shell, then the $TERM will be set to
|
||||||
* xterm, so we are going to want to edit. Unfortunately emacs
|
* xterm, so we are going to want to edit. Unfortunately emacs
|
||||||
* does not restore all the tty modes, so xterm is not very well
|
* does not restore all the tty modes, so xterm is not very well
|
||||||
* set up. But this is not the shell's fault.
|
* set up. But this is not the shell's fault.
|
||||||
* Also don't edit if $TERM == wm, for when we're running under an ATK app.
|
* Also don't edit if $TERM == wm, for when we're running under an ATK app.
|
||||||
* Finally, emacs compiled under terminfo, sets the terminal to dumb,
|
* Finally, emacs compiled under terminfo, sets the terminal to dumb,
|
||||||
* so disable editing for that too.
|
* so disable editing for that too.
|
||||||
*
|
*
|
||||||
* Unfortunately, in some cases the initial $TERM setting is "unknown",
|
* Unfortunately, in some cases the initial $TERM setting is "unknown",
|
||||||
* "dumb", or "network" which is then changed in the user's startup files.
|
* "dumb", or "network" which is then changed in the user's startup files.
|
||||||
* We fix this by setting noediting here if $TERM is unknown/dumb and
|
* We fix this by setting noediting here if $TERM is unknown/dumb and
|
||||||
@ -735,9 +735,9 @@ main(int argc, char **argv)
|
|||||||
editing = ((tcp = getenv("EMACS")) == NULL || strcmp(tcp, "t") != 0);
|
editing = ((tcp = getenv("EMACS")) == NULL || strcmp(tcp, "t") != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The 'edit' variable is either set or unset. It doesn't
|
* The 'edit' variable is either set or unset. It doesn't
|
||||||
* need a value. Making it 'emacs' might be confusing.
|
* need a value. Making it 'emacs' might be confusing.
|
||||||
*/
|
*/
|
||||||
if (editing)
|
if (editing)
|
||||||
setNS(STRedit);
|
setNS(STRedit);
|
||||||
@ -753,7 +753,7 @@ main(int argc, char **argv)
|
|||||||
* Compatibility with tcsh >= 6.12 by default
|
* Compatibility with tcsh >= 6.12 by default
|
||||||
*/
|
*/
|
||||||
setNS(STRcsubstnonl);
|
setNS(STRcsubstnonl);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Random default kill ring size
|
* Random default kill ring size
|
||||||
*/
|
*/
|
||||||
@ -789,7 +789,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if ((tcp = getenv("SHELL")) != NULL) {
|
if ((tcp = getenv("SHELL")) != NULL) {
|
||||||
sh_len = strlen(tcp);
|
sh_len = strlen(tcp);
|
||||||
if ((sh_len >= 5 && strcmp(tcp + (sh_len - 5), "/tcsh") == 0) ||
|
if ((sh_len >= 5 && strcmp(tcp + (sh_len - 5), "/tcsh") == 0) ||
|
||||||
(!tcsh && sh_len >= 4 && strcmp(tcp + (sh_len - 4), "/csh") == 0))
|
(!tcsh && sh_len >= 4 && strcmp(tcp + (sh_len - 4), "/csh") == 0))
|
||||||
setv(STRshell, quote(SAVE(tcp)), VAR_READWRITE);
|
setv(STRshell, quote(SAVE(tcp)), VAR_READWRITE);
|
||||||
else
|
else
|
||||||
@ -824,7 +824,7 @@ main(int argc, char **argv)
|
|||||||
xfree(tmp);
|
xfree(tmp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tmp2 = SAVE("");
|
tmp2 = SAVE("");
|
||||||
}
|
}
|
||||||
shtemp = Strspl(tmp2, doldol); /* For << */
|
shtemp = Strspl(tmp2, doldol); /* For << */
|
||||||
xfree(tmp2);
|
xfree(tmp2);
|
||||||
@ -875,7 +875,7 @@ main(int argc, char **argv)
|
|||||||
nt_autoset_dspmbyte();
|
nt_autoset_dspmbyte();
|
||||||
#endif /* WINNT_NATIVE */
|
#endif /* WINNT_NATIVE */
|
||||||
#endif
|
#endif
|
||||||
#if defined(AUTOSET_KANJI)
|
#if defined(AUTOSET_KANJI)
|
||||||
# if defined(NLS) && defined(LC_CTYPE)
|
# if defined(NLS) && defined(LC_CTYPE)
|
||||||
if (setlocale(LC_CTYPE, NULL) != NULL || getenv("LANG") != NULL)
|
if (setlocale(LC_CTYPE, NULL) != NULL || getenv("LANG") != NULL)
|
||||||
# else
|
# else
|
||||||
@ -896,12 +896,12 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Process the arguments.
|
* Process the arguments.
|
||||||
*
|
*
|
||||||
* Note that processing of -v/-x is actually delayed till after script
|
* Note that processing of -v/-x is actually delayed till after script
|
||||||
* processing.
|
* processing.
|
||||||
*
|
*
|
||||||
* We set the first character of our name to be '-' if we are a shell
|
* We set the first character of our name to be '-' if we are a shell
|
||||||
* running interruptible commands. Many programs which examine ps'es
|
* running interruptible commands. Many programs which examine ps'es
|
||||||
* use this to filter such shells out.
|
* use this to filter such shells out.
|
||||||
*/
|
*/
|
||||||
argc--, tempv++;
|
argc--, tempv++;
|
||||||
@ -1024,8 +1024,8 @@ main(int argc, char **argv)
|
|||||||
case '\t':
|
case '\t':
|
||||||
case '\r':
|
case '\r':
|
||||||
case '\n':
|
case '\n':
|
||||||
/*
|
/*
|
||||||
* for O/S's that don't do the argument parsing right in
|
* for O/S's that don't do the argument parsing right in
|
||||||
* "#!/foo -f " scripts
|
* "#!/foo -f " scripts
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
@ -1057,12 +1057,12 @@ main(int argc, char **argv)
|
|||||||
xfree(ffile);
|
xfree(ffile);
|
||||||
dolzero = 1;
|
dolzero = 1;
|
||||||
ffile = SAVE(tempv[0]);
|
ffile = SAVE(tempv[0]);
|
||||||
/*
|
/*
|
||||||
* Replace FSHIN. Handle /dev/std{in,out,err} specially
|
* Replace FSHIN. Handle /dev/std{in,out,err} specially
|
||||||
* since once they are closed we cannot open them again.
|
* since once they are closed we cannot open them again.
|
||||||
* In that case we use our own saved descriptors
|
* In that case we use our own saved descriptors
|
||||||
*/
|
*/
|
||||||
if ((SHIN = dmove(nofile, FSHIN)) < 0)
|
if ((SHIN = dmove(nofile, FSHIN)) < 0)
|
||||||
switch(nofile) {
|
switch(nofile) {
|
||||||
case 0:
|
case 0:
|
||||||
SHIN = FSHIN;
|
SHIN = FSHIN;
|
||||||
@ -1082,7 +1082,7 @@ main(int argc, char **argv)
|
|||||||
/* argc not used any more */ tempv++;
|
/* argc not used any more */ tempv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call to closem() used to be part of initdesc(). Now called below where
|
* Call to closem() used to be part of initdesc(). Now called below where
|
||||||
* the script name argument has become stdin. Kernel may have used a file
|
* the script name argument has become stdin. Kernel may have used a file
|
||||||
* descriptor to hold the name of the script (setuid case) and this name
|
* descriptor to hold the name of the script (setuid case) and this name
|
||||||
@ -1153,13 +1153,13 @@ main(int argc, char **argv)
|
|||||||
sigset_interrupting(SIGINT, queue_pintr);
|
sigset_interrupting(SIGINT, queue_pintr);
|
||||||
(void) signal(SIGTERM, SIG_IGN);
|
(void) signal(SIGTERM, SIG_IGN);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No reason I can see not to save history on all these events..
|
* No reason I can see not to save history on all these events..
|
||||||
* Most usual occurrence is in a window system, where we're not a login
|
* Most usual occurrence is in a window system, where we're not a login
|
||||||
* shell, but might as well be... (sg)
|
* shell, but might as well be... (sg)
|
||||||
* But there might be races when lots of shells exit together...
|
* But there might be races when lots of shells exit together...
|
||||||
* [this is also incompatible].
|
* [this is also incompatible].
|
||||||
* We have to be mre careful here. If the parent wants to
|
* We have to be mre careful here. If the parent wants to
|
||||||
* ignore the signals then we leave them untouched...
|
* ignore the signals then we leave them untouched...
|
||||||
* We also only setup the handlers for shells that are trully
|
* We also only setup the handlers for shells that are trully
|
||||||
* interactive.
|
* interactive.
|
||||||
@ -1299,10 +1299,10 @@ main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
sigset_interrupting(SIGCHLD, queue_pchild);
|
sigset_interrupting(SIGCHLD, queue_pchild);
|
||||||
|
|
||||||
if (intty && !targinp)
|
if (intty && !targinp)
|
||||||
(void) ed_Setup(editing);/* Get the tty state, and set defaults */
|
(void) ed_Setup(editing);/* Get the tty state, and set defaults */
|
||||||
/* Only alter the tty state if editing */
|
/* Only alter the tty state if editing */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set an exit here in case of an interrupt or error reading the shell
|
* Set an exit here in case of an interrupt or error reading the shell
|
||||||
* start-up scripts.
|
* start-up scripts.
|
||||||
@ -1388,7 +1388,7 @@ main(int argc, char **argv)
|
|||||||
setNS(STRverbose);
|
setNS(STRverbose);
|
||||||
if (nexececho)
|
if (nexececho)
|
||||||
setNS(STRecho);
|
setNS(STRecho);
|
||||||
|
|
||||||
|
|
||||||
if (targinp) {
|
if (targinp) {
|
||||||
/* If this -c command caused an error before, skip processing */
|
/* If this -c command caused an error before, skip processing */
|
||||||
@ -1515,7 +1515,7 @@ importpath(Char *cp)
|
|||||||
static int
|
static int
|
||||||
srccat(Char *cp, Char *dp)
|
srccat(Char *cp, Char *dp)
|
||||||
{
|
{
|
||||||
if (cp[0] == '/' && cp[1] == '\0')
|
if (cp[0] == '/' && cp[1] == '\0')
|
||||||
return srcfile(short2str(dp), (mflag ? 0 : 1), 0, NULL);
|
return srcfile(short2str(dp), (mflag ? 0 : 1), 0, NULL);
|
||||||
else {
|
else {
|
||||||
Char *ep;
|
Char *ep;
|
||||||
@ -1550,7 +1550,7 @@ srcfile(const char *f, int onlyown, int flag, Char **av)
|
|||||||
{
|
{
|
||||||
int unit;
|
int unit;
|
||||||
|
|
||||||
if ((unit = xopen(f, O_RDONLY|O_LARGEFILE)) == -1)
|
if ((unit = xopen(f, O_RDONLY|O_LARGEFILE)) == -1)
|
||||||
return 0;
|
return 0;
|
||||||
cleanup_push(&unit, open_cleanup);
|
cleanup_push(&unit, open_cleanup);
|
||||||
unit = dmove(unit, -1);
|
unit = dmove(unit, -1);
|
||||||
@ -1625,7 +1625,7 @@ st_save(struct saved_state *st, int unit, int hflg, Char **al, Char **av)
|
|||||||
cpybin(st->B, B);
|
cpybin(st->B, B);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we can now pass arguments to source.
|
* we can now pass arguments to source.
|
||||||
* For compatibility we do that only if arguments were really
|
* For compatibility we do that only if arguments were really
|
||||||
* passed, otherwise we keep the old, global $argv like before.
|
* passed, otherwise we keep the old, global $argv like before.
|
||||||
*/
|
*/
|
||||||
@ -1854,25 +1854,25 @@ phup(void)
|
|||||||
|
|
||||||
record();
|
record();
|
||||||
|
|
||||||
#ifdef POSIXJOBS
|
#ifdef POSIXJOBS
|
||||||
/*
|
/*
|
||||||
* We kill the last foreground process group. It then becomes
|
* We kill the last foreground process group. It then becomes
|
||||||
* responsible to propagate the SIGHUP to its progeny.
|
* responsible to propagate the SIGHUP to its progeny.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
struct process *pp, *np;
|
struct process *pp, *np;
|
||||||
|
|
||||||
for (pp = proclist.p_next; pp; pp = pp->p_next) {
|
for (pp = proclist.p_next; pp; pp = pp->p_next) {
|
||||||
np = pp;
|
np = pp;
|
||||||
/*
|
/*
|
||||||
* Find if this job is in the foreground. It could be that
|
* Find if this job is in the foreground. It could be that
|
||||||
* the process leader has exited and the foreground flag
|
* the process leader has exited and the foreground flag
|
||||||
* is cleared for it.
|
* is cleared for it.
|
||||||
*/
|
*/
|
||||||
do
|
do
|
||||||
/*
|
/*
|
||||||
* If a process is in the foreground we try to kill
|
* If a process is in the foreground we try to kill
|
||||||
* it's process group. If we succeed, then the
|
* it's process group. If we succeed, then the
|
||||||
* whole job is gone. Otherwise we keep going...
|
* whole job is gone. Otherwise we keep going...
|
||||||
* But avoid sending HUP to the shell again.
|
* But avoid sending HUP to the shell again.
|
||||||
*/
|
*/
|
||||||
@ -1951,7 +1951,7 @@ pintr1(int wantnl)
|
|||||||
}
|
}
|
||||||
else if (intty && wantnl) {
|
else if (intty && wantnl) {
|
||||||
if (editing) {
|
if (editing) {
|
||||||
/*
|
/*
|
||||||
* If we are editing a multi-line input command, and move to
|
* If we are editing a multi-line input command, and move to
|
||||||
* the beginning of the line, we don't want to trash it when
|
* the beginning of the line, we don't want to trash it when
|
||||||
* we hit ^C
|
* we hit ^C
|
||||||
@ -2095,7 +2095,7 @@ process(int catch)
|
|||||||
/*
|
/*
|
||||||
* Save input text on the history list if reading in old history, or it
|
* Save input text on the history list if reading in old history, or it
|
||||||
* is from the terminal at the top level and not in a loop.
|
* is from the terminal at the top level and not in a loop.
|
||||||
*
|
*
|
||||||
* PWP: entry of items in the history list while in a while loop is done
|
* PWP: entry of items in the history list while in a while loop is done
|
||||||
* elsewhere...
|
* elsewhere...
|
||||||
*/
|
*/
|
||||||
@ -2320,7 +2320,7 @@ mailchk(void)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *type;
|
char *type;
|
||||||
|
|
||||||
if (stb.st_size == 0 || stb.st_atime >= stb.st_mtime ||
|
if (stb.st_size == 0 || stb.st_atime >= stb.st_mtime ||
|
||||||
(stb.st_atime <= chktim && stb.st_mtime <= chktim) ||
|
(stb.st_atime <= chktim && stb.st_mtime <= chktim) ||
|
||||||
(loginsh && !new))
|
(loginsh && !new))
|
||||||
|
@ -841,7 +841,6 @@ unsigned short _mbmap_big5[256] = {
|
|||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
@ -849,7 +848,8 @@ unsigned short _mbmap_big5[256] = {
|
|||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
_MB1|_MB2, _MB1|_MB2, _MB1|_MB2, _MB1|_MB2,
|
||||||
@ -1092,76 +1092,76 @@ unsigned short _toebcdic[256] = {
|
|||||||
#endif /*_OSD_POSIX*/
|
#endif /*_OSD_POSIX*/
|
||||||
|
|
||||||
#ifdef __MVS__
|
#ifdef __MVS__
|
||||||
/*
|
/*
|
||||||
The IBM 1047 coded char set to/from ISO 8859-1 mapping differs from
|
The IBM 1047 coded char set to/from ISO 8859-1 mapping differs from
|
||||||
the POSIX-BC mapping in several places
|
the POSIX-BC mapping in several places
|
||||||
*/
|
*/
|
||||||
unsigned short _toascii[256] = {
|
unsigned short _toascii[256] = {
|
||||||
0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f,
|
0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f,
|
||||||
0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||||
0x10, 0x11, 0x12, 0x13, 0x9d, 0x0a, 0x08, 0x87,
|
0x10, 0x11, 0x12, 0x13, 0x9d, 0x0a, 0x08, 0x87,
|
||||||
0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f,
|
0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1b,
|
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1b,
|
||||||
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,
|
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,
|
||||||
0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04,
|
0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04,
|
||||||
0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a,
|
0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a,
|
||||||
0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5,
|
0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5,
|
||||||
0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
|
0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
|
||||||
0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef,
|
0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef,
|
||||||
0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e,
|
0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e,
|
||||||
0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5,
|
0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5,
|
||||||
0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
|
0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
|
||||||
0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf,
|
0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf,
|
||||||
0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
|
0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
|
||||||
0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
|
0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
|
||||||
0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1,
|
0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1,
|
||||||
0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
|
0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
|
||||||
0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4,
|
0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4,
|
||||||
0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
|
0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
|
||||||
0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0x5b, 0xde, 0xae,
|
0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0x5b, 0xde, 0xae,
|
||||||
0xac, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc,
|
0xac, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc,
|
||||||
0xbd, 0xbe, 0xdd, 0xa8, 0xaf, 0x5d, 0xb4, 0xd7,
|
0xbd, 0xbe, 0xdd, 0xa8, 0xaf, 0x5d, 0xb4, 0xd7,
|
||||||
0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
|
0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
|
||||||
0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5,
|
0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5,
|
||||||
0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
|
0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
|
||||||
0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff,
|
0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff,
|
||||||
0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
|
0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
|
||||||
0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5,
|
0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5,
|
||||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
|
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
|
||||||
0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f,
|
0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f,
|
||||||
};
|
};
|
||||||
unsigned short _toebcdic[256] = {
|
unsigned short _toebcdic[256] = {
|
||||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f,
|
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f,
|
||||||
0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26,
|
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26,
|
||||||
0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d,
|
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d,
|
||||||
0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
|
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
|
||||||
0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||||
0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
|
0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
|
||||||
0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
|
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
|
||||||
0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
|
0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
|
||||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
|
||||||
0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
|
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
|
||||||
0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
|
0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
|
||||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17,
|
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17,
|
||||||
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08,
|
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08,
|
||||||
0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xff,
|
0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xff,
|
||||||
0x41, 0xaa, 0x4a, 0xb1, 0x9f, 0xb2, 0x6a, 0xb5,
|
0x41, 0xaa, 0x4a, 0xb1, 0x9f, 0xb2, 0x6a, 0xb5,
|
||||||
0xbb, 0xb4, 0x9a, 0x8a, 0xb0, 0xca, 0xaf, 0xbc,
|
0xbb, 0xb4, 0x9a, 0x8a, 0xb0, 0xca, 0xaf, 0xbc,
|
||||||
0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3,
|
0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3,
|
||||||
0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab,
|
0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab,
|
||||||
0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68,
|
0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68,
|
||||||
0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77,
|
0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77,
|
||||||
0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf,
|
0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf,
|
||||||
0x80, 0xfd, 0xfe, 0xfb, 0xfc, 0xba, 0xae, 0x59,
|
0x80, 0xfd, 0xfe, 0xfb, 0xfc, 0xba, 0xae, 0x59,
|
||||||
0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48,
|
0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48,
|
||||||
0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57,
|
0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57,
|
||||||
0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1,
|
0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1,
|
||||||
0x70, 0xdd, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf
|
0x70, 0xdd, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf
|
||||||
};
|
};
|
||||||
#endif /*__MVS__*/
|
#endif /*__MVS__*/
|
||||||
|
@ -235,7 +235,7 @@ extern tcshuc _cmap_lower[], _cmap_upper[];
|
|||||||
# define Iscntrl(c) (((Char)(c) & QUOTE) ? 0 : iscntrl((tcshuc) (c)))
|
# define Iscntrl(c) (((Char)(c) & QUOTE) ? 0 : iscntrl((tcshuc) (c)))
|
||||||
#endif /* !defined(DSPMBYTE) */
|
#endif /* !defined(DSPMBYTE) */
|
||||||
# if SOLARIS2 == 24
|
# if SOLARIS2 == 24
|
||||||
/*
|
/*
|
||||||
* From <casper@fwi.uva.nl> Casper Dik:
|
* From <casper@fwi.uva.nl> Casper Dik:
|
||||||
* In Solaris 2.4, isprint('\t') returns true after setlocal(LC_ALL,"").
|
* In Solaris 2.4, isprint('\t') returns true after setlocal(LC_ALL,"").
|
||||||
* This breaks commandline editing when you include tabs.
|
* This breaks commandline editing when you include tabs.
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
extern Char *gethdir (const Char *);
|
extern Char *gethdir (const Char *);
|
||||||
extern void dosource (Char **, struct command *);
|
extern void dosource (Char **, struct command *);
|
||||||
extern void exitstat (void);
|
extern void exitstat (void) __attribute__((__noreturn__));
|
||||||
extern void goodbye (Char **, struct command *);
|
extern void goodbye (Char **, struct command *);
|
||||||
extern void importpath (Char *);
|
extern void importpath (Char *);
|
||||||
extern void initdesc (void);
|
extern void initdesc (void);
|
||||||
@ -410,31 +410,31 @@ extern void donice (Char **, struct command *);
|
|||||||
extern void dotime (Char **, struct command *);
|
extern void dotime (Char **, struct command *);
|
||||||
#ifdef BSDTIMES
|
#ifdef BSDTIMES
|
||||||
extern void prusage (struct sysrusage *,
|
extern void prusage (struct sysrusage *,
|
||||||
struct sysrusage *,
|
struct sysrusage *,
|
||||||
timeval_t *, timeval_t *);
|
timeval_t *, timeval_t *);
|
||||||
extern void ruadd (struct sysrusage *,
|
extern void ruadd (struct sysrusage *,
|
||||||
struct sysrusage *);
|
struct sysrusage *);
|
||||||
#else /* BSDTIMES */
|
#else /* BSDTIMES */
|
||||||
# ifdef _SEQUENT_
|
# ifdef _SEQUENT_
|
||||||
extern void prusage (struct process_stats *,
|
extern void prusage (struct process_stats *,
|
||||||
struct process_stats *,
|
struct process_stats *,
|
||||||
timeval_t *, timeval_t *);
|
timeval_t *, timeval_t *);
|
||||||
extern void ruadd (struct process_stats *,
|
extern void ruadd (struct process_stats *,
|
||||||
struct process_stats *);
|
struct process_stats *);
|
||||||
# else /* !_SEQUENT_ */
|
# else /* !_SEQUENT_ */
|
||||||
# ifdef POSIX
|
# ifdef POSIX
|
||||||
extern void prusage (struct tms *, struct tms *,
|
extern void prusage (struct tms *, struct tms *,
|
||||||
clock_t, clock_t);
|
clock_t, clock_t);
|
||||||
# else /* !POSIX */
|
# else /* !POSIX */
|
||||||
extern void prusage (struct tms *, struct tms *,
|
extern void prusage (struct tms *, struct tms *,
|
||||||
time_t, time_t);
|
time_t, time_t);
|
||||||
# endif /* !POSIX */
|
# endif /* !POSIX */
|
||||||
# endif /* !_SEQUENT_ */
|
# endif /* !_SEQUENT_ */
|
||||||
#endif /* BSDTIMES */
|
#endif /* BSDTIMES */
|
||||||
extern void settimes (void);
|
extern void settimes (void);
|
||||||
#if defined(BSDTIMES) || defined(_SEQUENT_)
|
#if defined(BSDTIMES) || defined(_SEQUENT_)
|
||||||
extern void tvsub (struct timeval *,
|
extern void tvsub (struct timeval *,
|
||||||
struct timeval *,
|
struct timeval *,
|
||||||
struct timeval *);
|
struct timeval *);
|
||||||
#endif /* BSDTIMES || _SEQUENT_ */
|
#endif /* BSDTIMES || _SEQUENT_ */
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ dset(Char *dp)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Don't call set() directly cause if the directory contains ` or
|
* Don't call set() directly cause if the directory contains ` or
|
||||||
* other junk characters glob will fail.
|
* other junk characters glob will fail.
|
||||||
*/
|
*/
|
||||||
setcopy(STRowd, varval(STRcwd), VAR_READWRITE|VAR_NOGLOB);
|
setcopy(STRowd, varval(STRcwd), VAR_READWRITE|VAR_NOGLOB);
|
||||||
setcopy(STRcwd, dp, VAR_READWRITE|VAR_NOGLOB);
|
setcopy(STRcwd, dp, VAR_READWRITE|VAR_NOGLOB);
|
||||||
@ -193,7 +193,7 @@ skipargs(Char ***v, const char *dstr, const char *str)
|
|||||||
Char **n = *v, *s;
|
Char **n = *v, *s;
|
||||||
|
|
||||||
int dflag = 0, loop = 1;
|
int dflag = 0, loop = 1;
|
||||||
for (n++; loop && *n != NULL && (*n)[0] == '-'; n++)
|
for (n++; loop && *n != NULL && (*n)[0] == '-'; n++)
|
||||||
if (*(s = &((*n)[1])) == '\0') /* test for bare "-" argument */
|
if (*(s = &((*n)[1])) == '\0') /* test for bare "-" argument */
|
||||||
dflag |= DIR_OLD;
|
dflag |= DIR_OLD;
|
||||||
else if ((*n)[1] == '-' && (*n)[2] == '\0') { /* test for -- */
|
else if ((*n)[1] == '-' && (*n)[2] == '\0') { /* test for -- */
|
||||||
@ -239,7 +239,7 @@ dodirs(Char **v, struct command *c)
|
|||||||
dhead.di_next = dhead.di_prev = dp;
|
dhead.di_next = dhead.di_prev = dp;
|
||||||
dp->di_next = dp->di_prev = &dhead;
|
dp->di_next = dp->di_prev = &dhead;
|
||||||
}
|
}
|
||||||
if ((dflag & DIR_LOAD) != 0)
|
if ((dflag & DIR_LOAD) != 0)
|
||||||
loaddirs(*v);
|
loaddirs(*v);
|
||||||
else if ((dflag & DIR_SAVE) != 0)
|
else if ((dflag & DIR_SAVE) != 0)
|
||||||
recdirs(*v, 1);
|
recdirs(*v, 1);
|
||||||
@ -270,7 +270,7 @@ printdirs(int dflag)
|
|||||||
xprintf("%d\t", idx++);
|
xprintf("%d\t", idx++);
|
||||||
cur = 0;
|
cur = 0;
|
||||||
}
|
}
|
||||||
s = dp->di_name;
|
s = dp->di_name;
|
||||||
user = NULL;
|
user = NULL;
|
||||||
if (!(dflag & DIR_LONG) && (user = getusername(&s)) != NULL)
|
if (!(dflag & DIR_LONG) && (user = getusername(&s)) != NULL)
|
||||||
len = (int) (Strlen(user) + Strlen(s) + 2);
|
len = (int) (Strlen(user) + Strlen(s) + 2);
|
||||||
@ -282,7 +282,7 @@ printdirs(int dflag)
|
|||||||
xputchar('\n');
|
xputchar('\n');
|
||||||
cur = len;
|
cur = len;
|
||||||
}
|
}
|
||||||
if (user)
|
if (user)
|
||||||
xprintf("~%S", user);
|
xprintf("~%S", user);
|
||||||
xprintf("%-S%c", s, (dflag & DIR_VERT) ? '\n' : ' ');
|
xprintf("%-S%c", s, (dflag & DIR_VERT) ? '\n' : ' ');
|
||||||
} while ((dp = dp->di_prev) != dcwd);
|
} while ((dp = dp->di_prev) != dcwd);
|
||||||
@ -321,7 +321,7 @@ dtilde(void)
|
|||||||
* 2) or starts with "../",
|
* 2) or starts with "../",
|
||||||
* 3) or ends with "/..",
|
* 3) or ends with "/..",
|
||||||
* 4) or contains the string "/../",
|
* 4) or contains the string "/../",
|
||||||
* then it will be normalized, unless those strings are quoted.
|
* then it will be normalized, unless those strings are quoted.
|
||||||
* Otherwise, a copy is made and sent back.
|
* Otherwise, a copy is made and sent back.
|
||||||
*/
|
*/
|
||||||
Char *
|
Char *
|
||||||
@ -354,7 +354,7 @@ dnormalize(const Char *cp, int expnd)
|
|||||||
*/
|
*/
|
||||||
if (dotdot == 0)
|
if (dotdot == 0)
|
||||||
return (Strsave(start));
|
return (Strsave(start));
|
||||||
|
|
||||||
# ifdef notdef
|
# ifdef notdef
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
/*
|
/*
|
||||||
@ -391,7 +391,7 @@ dnormalize(const Char *cp, int expnd)
|
|||||||
do {
|
do {
|
||||||
dotdot = 0;
|
dotdot = 0;
|
||||||
buf.len = 0;
|
buf.len = 0;
|
||||||
while (*cp)
|
while (*cp)
|
||||||
if (IS_DOT(start, cp)) {
|
if (IS_DOT(start, cp)) {
|
||||||
if (*++cp)
|
if (*++cp)
|
||||||
cp++;
|
cp++;
|
||||||
@ -404,14 +404,14 @@ dnormalize(const Char *cp, int expnd)
|
|||||||
if (*cp)
|
if (*cp)
|
||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Strbuf_append1(&buf, *cp++);
|
Strbuf_append1(&buf, *cp++);
|
||||||
|
|
||||||
Strbuf_terminate(&buf);
|
Strbuf_terminate(&buf);
|
||||||
while (dotdot > 0)
|
while (dotdot > 0)
|
||||||
if ((dp = Strrchr(cwd, '/')) != NULL) {
|
if ((dp = Strrchr(cwd, '/')) != NULL) {
|
||||||
# ifdef HAVE_SLASHSLASH
|
# ifdef HAVE_SLASHSLASH
|
||||||
if (dp == &cwd[1])
|
if (dp == &cwd[1])
|
||||||
slashslash = 1;
|
slashslash = 1;
|
||||||
# endif /* HAVE_SLASHSLASH */
|
# endif /* HAVE_SLASHSLASH */
|
||||||
*dp = '\0';
|
*dp = '\0';
|
||||||
@ -589,7 +589,7 @@ dfollow(Char *cp, int old)
|
|||||||
#ifdef apollo
|
#ifdef apollo
|
||||||
if (Strchr(cp, '`')) {
|
if (Strchr(cp, '`')) {
|
||||||
char *dptr;
|
char *dptr;
|
||||||
if (chdir(dptr = short2str(cp)) < 0)
|
if (chdir(dptr = short2str(cp)) < 0)
|
||||||
stderror(ERR_SYSTEM, dptr, strerror(errno));
|
stderror(ERR_SYSTEM, dptr, strerror(errno));
|
||||||
dp = agetcwd();
|
dp = agetcwd();
|
||||||
cleanup_push(dp, xfree);
|
cleanup_push(dp, xfree);
|
||||||
@ -605,7 +605,7 @@ dfollow(Char *cp, int old)
|
|||||||
/*
|
/*
|
||||||
* if we are ignoring symlinks, try to fix relatives now.
|
* if we are ignoring symlinks, try to fix relatives now.
|
||||||
* if we are expading symlinks, it should be done by now.
|
* if we are expading symlinks, it should be done by now.
|
||||||
*/
|
*/
|
||||||
dp = dnormalize(cp, symlinks == SYM_IGNORE);
|
dp = dnormalize(cp, symlinks == SYM_IGNORE);
|
||||||
if (chdir(short2str(dp)) >= 0) {
|
if (chdir(short2str(dp)) >= 0) {
|
||||||
cleanup_until(cp);
|
cleanup_until(cp);
|
||||||
@ -646,7 +646,7 @@ dfollow(Char *cp, int old)
|
|||||||
* We always want to fix the directory here
|
* We always want to fix the directory here
|
||||||
* If we are normalizing symlinks
|
* If we are normalizing symlinks
|
||||||
*/
|
*/
|
||||||
dp = dnormalize(buf.s, symlinks == SYM_IGNORE ||
|
dp = dnormalize(buf.s, symlinks == SYM_IGNORE ||
|
||||||
symlinks == SYM_EXPAND);
|
symlinks == SYM_EXPAND);
|
||||||
if (chdir(short2str(dp)) >= 0) {
|
if (chdir(short2str(dp)) >= 0) {
|
||||||
printd = 1;
|
printd = 1;
|
||||||
@ -696,7 +696,7 @@ dopushd(Char **v, struct command *c)
|
|||||||
struct directory *dp;
|
struct directory *dp;
|
||||||
Char *cp;
|
Char *cp;
|
||||||
int dflag = skipargs(&v, "plvn", " [-|<dir>|+<n>]");
|
int dflag = skipargs(&v, "plvn", " [-|<dir>|+<n>]");
|
||||||
|
|
||||||
USE(c);
|
USE(c);
|
||||||
printd = 1;
|
printd = 1;
|
||||||
cp = (dflag & DIR_OLD) ? varval(STRowd) : *v;
|
cp = (dflag & DIR_OLD) ? varval(STRowd) : *v;
|
||||||
@ -937,7 +937,7 @@ dcanon_internal(Char *cp, Char *p)
|
|||||||
continue;
|
continue;
|
||||||
p = sp; /* save start of component */
|
p = sp; /* save start of component */
|
||||||
slash = 0;
|
slash = 0;
|
||||||
if (*p)
|
if (*p)
|
||||||
while (*++p) /* find next slash or end of path */
|
while (*++p) /* find next slash or end of path */
|
||||||
if (*p == '/') {
|
if (*p == '/') {
|
||||||
slash = 1;
|
slash = 1;
|
||||||
@ -950,7 +950,7 @@ dcanon_internal(Char *cp, Char *p)
|
|||||||
slashslash = 1;
|
slashslash = 1;
|
||||||
#endif /* HAVE_SLASHSLASH */
|
#endif /* HAVE_SLASHSLASH */
|
||||||
if (*sp == '\0') { /* if component is null */
|
if (*sp == '\0') { /* if component is null */
|
||||||
if (--sp == cp) /* if path is one char (i.e. /) */
|
if (--sp == cp) /* if path is one char (i.e. /) */
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
*sp = '\0';
|
*sp = '\0';
|
||||||
@ -1197,7 +1197,7 @@ dnewcwd(struct directory *dp, int dflag)
|
|||||||
if (adrof(STRdunique)) {
|
if (adrof(STRdunique)) {
|
||||||
struct directory *dn;
|
struct directory *dn;
|
||||||
|
|
||||||
for (dn = dhead.di_prev; dn != &dhead; dn = dn->di_prev)
|
for (dn = dhead.di_prev; dn != &dhead; dn = dn->di_prev)
|
||||||
if (dn != dp && Strcmp(dn->di_name, dp->di_name) == 0) {
|
if (dn != dp && Strcmp(dn->di_name, dp->di_name) == 0) {
|
||||||
dn->di_next->di_prev = dn->di_prev;
|
dn->di_next->di_prev = dn->di_prev;
|
||||||
dn->di_prev->di_next = dn->di_next;
|
dn->di_prev->di_next = dn->di_next;
|
||||||
@ -1262,7 +1262,7 @@ dgetstack(void)
|
|||||||
Char **dblk, **dbp;
|
Char **dblk, **dbp;
|
||||||
struct directory *dn;
|
struct directory *dn;
|
||||||
|
|
||||||
if (adrof(STRdirstack) == NULL)
|
if (adrof(STRdirstack) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (dn = dhead.di_prev; dn != &dhead; dn = dn->di_prev, i++)
|
for (dn = dhead.di_prev; dn != &dhead; dn = dn->di_prev, i++)
|
||||||
@ -1366,7 +1366,7 @@ recdirs(Char *fname, int def)
|
|||||||
Char *snum;
|
Char *snum;
|
||||||
struct Strbuf qname = Strbuf_INIT;
|
struct Strbuf qname = Strbuf_INIT;
|
||||||
|
|
||||||
if (fname == NULL && !def)
|
if (fname == NULL && !def)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ophup_disabled = phup_disabled;
|
ophup_disabled = phup_disabled;
|
||||||
@ -1377,7 +1377,7 @@ recdirs(Char *fname, int def)
|
|||||||
else
|
else
|
||||||
fname = Strsave(fname);
|
fname = Strsave(fname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fname = globone(fname, G_ERROR);
|
fname = globone(fname, G_ERROR);
|
||||||
cleanup_push(fname, xfree);
|
cleanup_push(fname, xfree);
|
||||||
|
|
||||||
@ -1387,7 +1387,7 @@ recdirs(Char *fname, int def)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((snum = varval(STRsavedirs)) == STRNULL || snum[0] == '\0')
|
if ((snum = varval(STRsavedirs)) == STRNULL || snum[0] == '\0')
|
||||||
num = (unsigned int) ~0;
|
num = (unsigned int) ~0;
|
||||||
else
|
else
|
||||||
num = (unsigned int) atoi(short2str(snum));
|
num = (unsigned int) atoi(short2str(snum));
|
||||||
|
@ -354,7 +354,7 @@ DgetC(int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Char *nulvec[] = { NULL };
|
static Char *nulvec[] = { NULL };
|
||||||
static struct varent nulargv = {nulvec, STRargv, VAR_READWRITE,
|
static struct varent nulargv = {nulvec, STRargv, VAR_READWRITE,
|
||||||
{ NULL, NULL, NULL }, 0 };
|
{ NULL, NULL, NULL }, 0 };
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -734,7 +734,7 @@ fixDolMod(void)
|
|||||||
}
|
}
|
||||||
c = DgetC(0);
|
c = DgetC(0);
|
||||||
}
|
}
|
||||||
if ((c == 'g' && dolmcnts[ndolflags - 1] != INT_MAX) ||
|
if ((c == 'g' && dolmcnts[ndolflags - 1] != INT_MAX) ||
|
||||||
(c == 'a' && dolaflags[ndolflags - 1] == 0)) {
|
(c == 'a' && dolaflags[ndolflags - 1] == 0)) {
|
||||||
if (c == 'g') {
|
if (c == 'g') {
|
||||||
dolmcnts[ndolflags - 1] = INT_MAX;
|
dolmcnts[ndolflags - 1] = INT_MAX;
|
||||||
@ -754,7 +754,7 @@ fixDolMod(void)
|
|||||||
|| Isdigit(delim) || any(" \t\n", delim)) {
|
|| Isdigit(delim) || any(" \t\n", delim)) {
|
||||||
seterror(ERR_BADSUBST);
|
seterror(ERR_BADSUBST);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while ((c = DgetC(0)) != DEOF) {
|
while ((c = DgetC(0)) != DEOF) {
|
||||||
Strbuf_append1(&dolmod, (Char) c);
|
Strbuf_append1(&dolmod, (Char) c);
|
||||||
if (c == delim) delimcnt--;
|
if (c == delim) delimcnt--;
|
||||||
@ -781,7 +781,7 @@ fixDolMod(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
all_dolmcnts_are_0()
|
all_dolmcnts_are_0(void)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < ndolflags; ++i) {
|
for (; i < ndolflags; ++i) {
|
||||||
@ -949,7 +949,7 @@ randsuf(void) {
|
|||||||
#ifndef WINNT_NATIVE
|
#ifndef WINNT_NATIVE
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
(void) gettimeofday(&tv, NULL);
|
(void) gettimeofday(&tv, NULL);
|
||||||
return putn((((tcsh_number_t)tv.tv_sec) ^
|
return putn((((tcsh_number_t)tv.tv_sec) ^
|
||||||
((tcsh_number_t)tv.tv_usec) ^
|
((tcsh_number_t)tv.tv_usec) ^
|
||||||
((tcsh_number_t)getpid())) & 0x00ffffff);
|
((tcsh_number_t)getpid())) & 0x00ffffff);
|
||||||
#else
|
#else
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* sh.err.c: Error printing routines.
|
* sh.err.c: Error printing routines.
|
||||||
*/
|
*/
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1980, 1991 The Regents of the University of California.
|
* Copyright (c) 1980, 1991 The Regents of the University of California.
|
||||||
|
@ -451,7 +451,7 @@ texec(Char *sf, Char **st)
|
|||||||
vp[0] = adrof(STRshell) ? varval(STRshell) : STR_SHELLPATH;
|
vp[0] = adrof(STRshell) ? varval(STRshell) : STR_SHELLPATH;
|
||||||
vp[1] = NULL;
|
vp[1] = NULL;
|
||||||
#ifdef _PATH_BSHELL
|
#ifdef _PATH_BSHELL
|
||||||
if (fd != -1
|
if (fd != -1
|
||||||
# ifndef ISC /* Compatible with ISC's /bin/csh */
|
# ifndef ISC /* Compatible with ISC's /bin/csh */
|
||||||
&& pref[0] != '#'
|
&& pref[0] != '#'
|
||||||
# endif /* ISC */
|
# endif /* ISC */
|
||||||
@ -653,8 +653,8 @@ dohash(Char **vv, struct command *c)
|
|||||||
uhashlength = atoi(short2str(vv[1]));
|
uhashlength = atoi(short2str(vv[1]));
|
||||||
if (vv[2]) {
|
if (vv[2]) {
|
||||||
uhashwidth = atoi(short2str(vv[2]));
|
uhashwidth = atoi(short2str(vv[2]));
|
||||||
if ((uhashwidth != sizeof(unsigned char)) &&
|
if ((uhashwidth != sizeof(unsigned char)) &&
|
||||||
(uhashwidth != sizeof(unsigned short)) &&
|
(uhashwidth != sizeof(unsigned short)) &&
|
||||||
(uhashwidth != sizeof(unsigned long)))
|
(uhashwidth != sizeof(unsigned long)))
|
||||||
uhashwidth = 0;
|
uhashwidth = 0;
|
||||||
if (vv[3])
|
if (vv[3])
|
||||||
@ -779,7 +779,7 @@ hashstat(Char **v, struct command *c)
|
|||||||
{
|
{
|
||||||
USE(c);
|
USE(c);
|
||||||
USE(v);
|
USE(v);
|
||||||
#ifdef FASTHASH
|
#ifdef FASTHASH
|
||||||
if (havhash && hashlength && hashwidth)
|
if (havhash && hashlength && hashwidth)
|
||||||
xprintf(CGETS(13, 2, "%d hash buckets of %d bits each\n"),
|
xprintf(CGETS(13, 2, "%d hash buckets of %d bits each\n"),
|
||||||
hashlength, hashwidth*8);
|
hashlength, hashwidth*8);
|
||||||
@ -1167,7 +1167,7 @@ find_cmd(Char *cmd, int prt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* If we are printing, we are being called from dowhere() which it
|
* If we are printing, we are being called from dowhere() which it
|
||||||
* has rehashed already
|
* has rehashed already
|
||||||
*/
|
*/
|
||||||
if (!prt && adrof(STRautorehash) && !rehashed && havhash) {
|
if (!prt && adrof(STRautorehash) && !rehashed && havhash) {
|
||||||
|
@ -96,21 +96,21 @@ sh_access(const Char *fname, int mode)
|
|||||||
#else /* POSIX */
|
#else /* POSIX */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* POSIX 1003.2-d11.2
|
* POSIX 1003.2-d11.2
|
||||||
* -r file True if file exists and is readable.
|
* -r file True if file exists and is readable.
|
||||||
* -w file True if file exists and is writable.
|
* -w file True if file exists and is writable.
|
||||||
* True shall indicate only that the write flag is on.
|
* True shall indicate only that the write flag is on.
|
||||||
* The file shall not be writable on a read-only file
|
* The file shall not be writable on a read-only file
|
||||||
* system even if this test indicates true.
|
* system even if this test indicates true.
|
||||||
* -x file True if file exists and is executable.
|
* -x file True if file exists and is executable.
|
||||||
* True shall indicate only that the execute flag is on.
|
* True shall indicate only that the execute flag is on.
|
||||||
* If file is a directory, true indicates that the file
|
* If file is a directory, true indicates that the file
|
||||||
* can be searched.
|
* can be searched.
|
||||||
*/
|
*/
|
||||||
if (mode != W_OK && mode != X_OK)
|
if (mode != W_OK && mode != X_OK)
|
||||||
return access(name, mode);
|
return access(name, mode);
|
||||||
|
|
||||||
if (stat(name, &statb) == -1)
|
if (stat(name, &statb) == -1)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (access(name, mode) == 0) {
|
if (access(name, mode) == 0) {
|
||||||
@ -132,7 +132,7 @@ sh_access(const Char *fname, int mode)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (euid == statb.st_uid)
|
else if (euid == statb.st_uid)
|
||||||
mode <<= 6;
|
mode <<= 6;
|
||||||
@ -197,7 +197,7 @@ exp0(Char ***vp, int ignore)
|
|||||||
|
|
||||||
(*vp)++;
|
(*vp)++;
|
||||||
|
|
||||||
p2 = compat_expr ?
|
p2 = compat_expr ?
|
||||||
exp0(vp, (ignore & TEXP_IGNORE) || p1) :
|
exp0(vp, (ignore & TEXP_IGNORE) || p1) :
|
||||||
exp1(vp, (ignore & TEXP_IGNORE) || p1);
|
exp1(vp, (ignore & TEXP_IGNORE) || p1);
|
||||||
if (compat_expr || !(ignore & TEXP_IGNORE))
|
if (compat_expr || !(ignore & TEXP_IGNORE))
|
||||||
@ -478,7 +478,7 @@ exp5(Char ***vp, int ignore)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup_push(p1, xfree);
|
cleanup_push(p1, xfree);
|
||||||
p2 = compat_expr ?
|
p2 = compat_expr ?
|
||||||
exp5(vp, ignore) :
|
exp5(vp, ignore) :
|
||||||
exp6(vp, ignore);
|
exp6(vp, ignore);
|
||||||
cleanup_push(p2, xfree);
|
cleanup_push(p2, xfree);
|
||||||
@ -598,7 +598,7 @@ exp6(Char ***vp, int ignore)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extended file tests
|
* Extended file tests
|
||||||
* From: John Rowe <rowe@excc.exeter.ac.uk>
|
* From: John Rowe <rowe@excc.exeter.ac.uk>
|
||||||
*/
|
*/
|
||||||
@ -680,7 +680,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
ep = globone(dp, G_APPEND);
|
ep = globone(dp, G_APPEND);
|
||||||
cleanup_push(ep, xfree);
|
cleanup_push(ep, xfree);
|
||||||
ft = &cp[1];
|
ft = &cp[1];
|
||||||
do
|
do
|
||||||
switch (*ft) {
|
switch (*ft) {
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
@ -696,7 +696,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'X': /* tcsh extension, name is an executable in the path
|
case 'X': /* tcsh extension, name is an executable in the path
|
||||||
* or a tcsh builtin command
|
* or a tcsh builtin command
|
||||||
*/
|
*/
|
||||||
i = find_cmd(ep, 0);
|
i = find_cmd(ep, 0);
|
||||||
break;
|
break;
|
||||||
@ -709,7 +709,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
|
|
||||||
#ifdef S_IFLNK
|
#ifdef S_IFLNK
|
||||||
if (tolower(*ft) == 'l') {
|
if (tolower(*ft) == 'l') {
|
||||||
/*
|
/*
|
||||||
* avoid convex compiler bug.
|
* avoid convex compiler bug.
|
||||||
*/
|
*/
|
||||||
if (!lst) {
|
if (!lst) {
|
||||||
@ -722,9 +722,9 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
if (*ft == 'L')
|
if (*ft == 'L')
|
||||||
st = lst;
|
st = lst;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* S_IFLNK */
|
#endif /* S_IFLNK */
|
||||||
/*
|
/*
|
||||||
* avoid convex compiler bug.
|
* avoid convex compiler bug.
|
||||||
*/
|
*/
|
||||||
if (!st) {
|
if (!st) {
|
||||||
@ -776,7 +776,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
i = 0;
|
i = 0;
|
||||||
#endif /* S_ISOFL */
|
#endif /* S_ISOFL */
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
#ifdef S_ISLNK
|
#ifdef S_ISLNK
|
||||||
@ -855,7 +855,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
case 'I':
|
case 'I':
|
||||||
i = (tcsh_number_t) st->st_ino;
|
i = (tcsh_number_t) st->st_ino;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'F':
|
case 'F':
|
||||||
strdev = putn( (int) st->st_dev);
|
strdev = putn( (int) st->st_dev);
|
||||||
strino = putn( (int) st->st_ino);
|
strino = putn( (int) st->st_ino);
|
||||||
@ -866,7 +866,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
xfree(strino);
|
xfree(strino);
|
||||||
cleanup_until(ep);
|
cleanup_until(ep);
|
||||||
return(strF);
|
return(strF);
|
||||||
|
|
||||||
case 'L':
|
case 'L':
|
||||||
if ( *(ft + 1) ) {
|
if ( *(ft + 1) ) {
|
||||||
i = 1;
|
i = 1;
|
||||||
@ -884,7 +884,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
i = 0;
|
i = 0;
|
||||||
break;
|
break;
|
||||||
#endif /* S_ISLNK */
|
#endif /* S_ISLNK */
|
||||||
|
|
||||||
|
|
||||||
case 'N':
|
case 'N':
|
||||||
i = (tcsh_number_t) st->st_nlink;
|
i = (tcsh_number_t) st->st_nlink;
|
||||||
@ -893,7 +893,7 @@ filetest(Char *cp, Char ***vp, int ignore)
|
|||||||
case 'P':
|
case 'P':
|
||||||
string = string0 + 1;
|
string = string0 + 1;
|
||||||
(void) xsnprintf(string, sizeof(string0) - 1, "%o",
|
(void) xsnprintf(string, sizeof(string0) - 1, "%o",
|
||||||
pmask & (unsigned int)
|
pmask & (unsigned int)
|
||||||
((S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID) & st->st_mode));
|
((S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID) & st->st_mode));
|
||||||
if (altout && *string != '0')
|
if (altout && *string != '0')
|
||||||
*--string = '0';
|
*--string = '0';
|
||||||
|
@ -112,7 +112,7 @@ setup_tty(int on)
|
|||||||
on = TCSETAF;
|
on = TCSETAF;
|
||||||
# endif /* POSIX */
|
# endif /* POSIX */
|
||||||
tchars.c_lflag |= ICANON;
|
tchars.c_lflag |= ICANON;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -74,7 +74,7 @@ isbfunc(struct command *t)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We never match a builtin that has quoted the first
|
* We never match a builtin that has quoted the first
|
||||||
* character; this has been the traditional way to escape
|
* character; this has been the traditional way to escape
|
||||||
* builtin commands.
|
* builtin commands.
|
||||||
*/
|
*/
|
||||||
if (*cp & QUOTE)
|
if (*cp & QUOTE)
|
||||||
@ -559,7 +559,7 @@ void
|
|||||||
dowhile(Char **v, struct command *c)
|
dowhile(Char **v, struct command *c)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
int again = whyles != 0 &&
|
int again = whyles != 0 &&
|
||||||
SEEKEQ(&whyles->w_start, &lineloc) &&
|
SEEKEQ(&whyles->w_start, &lineloc) &&
|
||||||
whyles->w_fename == 0;
|
whyles->w_fename == 0;
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ search(int type, int level, Char *goal)
|
|||||||
}
|
}
|
||||||
cleanup_push(&word, Strbuf_cleanup);
|
cleanup_push(&word, Strbuf_cleanup);
|
||||||
do {
|
do {
|
||||||
|
|
||||||
if (intty) {
|
if (intty) {
|
||||||
histent = xmalloc(sizeof(*histent));
|
histent = xmalloc(sizeof(*histent));
|
||||||
ohistent = xmalloc(sizeof(*histent));
|
ohistent = xmalloc(sizeof(*histent));
|
||||||
@ -804,7 +804,7 @@ search(int type, int level, Char *goal)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((type == TC_IF || type == TC_ELSE) &&
|
if ((type == TC_IF || type == TC_ELSE) &&
|
||||||
eq(word.s, STRthen))
|
eq(word.s, STRthen))
|
||||||
level++;
|
level++;
|
||||||
@ -887,7 +887,7 @@ search(int type, int level, Char *goal)
|
|||||||
savehist(ohistent, 0);
|
savehist(ohistent, 0);
|
||||||
freelex(ohistent);
|
freelex(ohistent);
|
||||||
xfree(ohistent);
|
xfree(ohistent);
|
||||||
} else
|
} else
|
||||||
(void) getword(NULL);
|
(void) getword(NULL);
|
||||||
} while (level >= 0);
|
} while (level >= 0);
|
||||||
end:
|
end:
|
||||||
@ -895,7 +895,7 @@ search(int type, int level, Char *goal)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct wordent *
|
static struct wordent *
|
||||||
histgetword(struct wordent *histent)
|
histgetword(struct wordent *histent)
|
||||||
{
|
{
|
||||||
int first;
|
int first;
|
||||||
eChar c, d;
|
eChar c, d;
|
||||||
@ -918,7 +918,7 @@ histgetword(struct wordent *histent)
|
|||||||
while (c != CHAR_ERR && c != '\n');
|
while (c != CHAR_ERR && c != '\n');
|
||||||
if (c == CHAR_ERR)
|
if (c == CHAR_ERR)
|
||||||
goto past;
|
goto past;
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
goto nl;
|
goto nl;
|
||||||
unreadc(c);
|
unreadc(c);
|
||||||
first = 1;
|
first = 1;
|
||||||
@ -942,9 +942,9 @@ histgetword(struct wordent *histent)
|
|||||||
}
|
}
|
||||||
if (c == CHAR_ERR)
|
if (c == CHAR_ERR)
|
||||||
goto past;
|
goto past;
|
||||||
|
|
||||||
Strbuf_append1(tmp, (Char) c);
|
Strbuf_append1(tmp, (Char) c);
|
||||||
|
|
||||||
if (!first && !d && c == '(' && !e) {
|
if (!first && !d && c == '(' && !e) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -967,7 +967,7 @@ histgetword(struct wordent *histent)
|
|||||||
return histent;
|
return histent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
past:
|
past:
|
||||||
switch (Stype) {
|
switch (Stype) {
|
||||||
|
|
||||||
@ -1055,7 +1055,7 @@ getword(struct Strbuf *wp)
|
|||||||
if (!first && !d && c == '(') {
|
if (!first && !d && c == '(') {
|
||||||
if (wp)
|
if (wp)
|
||||||
goto past_word_end;
|
goto past_word_end;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
first = 0;
|
first = 0;
|
||||||
@ -1152,7 +1152,7 @@ wfree(void)
|
|||||||
|
|
||||||
#ifdef FDEBUG
|
#ifdef FDEBUG
|
||||||
xprintf("start->type %c start->a_seek %d start->f_seek %d\n",
|
xprintf("start->type %c start->a_seek %d start->f_seek %d\n",
|
||||||
foo[wp->w_start.type+1],
|
foo[wp->w_start.type+1],
|
||||||
wp->w_start.a_seek, wp->w_start.f_seek);
|
wp->w_start.a_seek, wp->w_start.f_seek);
|
||||||
xprintf("end->type %c end->a_seek %d end->f_seek %d\n",
|
xprintf("end->type %c end->a_seek %d end->f_seek %d\n",
|
||||||
foo[wp->w_end.type + 1], wp->w_end.a_seek, wp->w_end.f_seek);
|
foo[wp->w_end.type + 1], wp->w_end.a_seek, wp->w_end.f_seek);
|
||||||
@ -1164,12 +1164,12 @@ wfree(void)
|
|||||||
if (wp->w_end.type != TCSH_I_SEEK && wp->w_start.type == wp->w_end.type &&
|
if (wp->w_end.type != TCSH_I_SEEK && wp->w_start.type == wp->w_end.type &&
|
||||||
wp->w_start.type == o.type) {
|
wp->w_start.type == o.type) {
|
||||||
if (wp->w_end.type == TCSH_F_SEEK) {
|
if (wp->w_end.type == TCSH_F_SEEK) {
|
||||||
if (o.f_seek >= wp->w_start.f_seek &&
|
if (o.f_seek >= wp->w_start.f_seek &&
|
||||||
(wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek))
|
(wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (o.a_seek >= wp->w_start.a_seek &&
|
if (o.a_seek >= wp->w_start.a_seek &&
|
||||||
(wp->w_end.a_seek == 0 || o.a_seek < wp->w_end.a_seek))
|
(wp->w_end.a_seek == 0 || o.a_seek < wp->w_end.a_seek))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1338,7 +1338,7 @@ xlate_cr_cleanup(void *dummy)
|
|||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
doprintenv(Char **v, struct command *c)
|
doprintenv(Char **v, struct command *c)
|
||||||
{
|
{
|
||||||
Char *e;
|
Char *e;
|
||||||
|
|
||||||
@ -1610,7 +1610,7 @@ dounsetenv(Char **v, struct command *c)
|
|||||||
name = xmalloc((maxi + 1) * sizeof(Char));
|
name = xmalloc((maxi + 1) * sizeof(Char));
|
||||||
cleanup_push(name, xfree);
|
cleanup_push(name, xfree);
|
||||||
|
|
||||||
while (++v && *v)
|
while (++v && *v)
|
||||||
for (maxi = 1; maxi;)
|
for (maxi = 1; maxi;)
|
||||||
for (maxi = 0, ep = STR_environ; *ep; ep++) {
|
for (maxi = 0, ep = STR_environ; *ep; ep++) {
|
||||||
for (n = name, p = *ep; *p && *p != '='; *n++ = *p++)
|
for (n = name, p = *ep; *p && *p != '='; *n++ = *p++)
|
||||||
@ -1897,7 +1897,7 @@ doumask(Char **v, struct command *c)
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
struct limits limits[] =
|
struct limits limits[] =
|
||||||
{
|
{
|
||||||
# ifdef RLIMIT_CPU
|
# ifdef RLIMIT_CPU
|
||||||
{ RLIMIT_CPU, "cputime", 1, "seconds" },
|
{ RLIMIT_CPU, "cputime", 1, "seconds" },
|
||||||
@ -1979,37 +1979,37 @@ struct limits limits[] =
|
|||||||
{ RLIMIT_SBSIZE, "sbsize", 1, "" },
|
{ RLIMIT_SBSIZE, "sbsize", 1, "" },
|
||||||
# endif /* RLIMIT_SBSIZE */
|
# endif /* RLIMIT_SBSIZE */
|
||||||
|
|
||||||
# ifdef RLIMIT_SWAP
|
# ifdef RLIMIT_SWAP
|
||||||
{ RLIMIT_SWAP, "swapsize", 1024, "kbytes" },
|
{ RLIMIT_SWAP, "swapsize", 1024, "kbytes" },
|
||||||
# endif /* RLIMIT_SWAP */
|
# endif /* RLIMIT_SWAP */
|
||||||
|
|
||||||
# ifdef RLIMIT_LOCKS
|
# ifdef RLIMIT_LOCKS
|
||||||
{ RLIMIT_LOCKS, "maxlocks", 1, "" },
|
{ RLIMIT_LOCKS, "maxlocks", 1, "" },
|
||||||
# endif /* RLIMIT_LOCKS */
|
# endif /* RLIMIT_LOCKS */
|
||||||
|
|
||||||
# ifdef RLIMIT_POSIXLOCKS
|
# ifdef RLIMIT_POSIXLOCKS
|
||||||
{ RLIMIT_POSIXLOCKS,"posixlocks", 1, "" },
|
{ RLIMIT_POSIXLOCKS,"posixlocks", 1, "" },
|
||||||
# endif /* RLIMIT_POSIXLOCKS */
|
# endif /* RLIMIT_POSIXLOCKS */
|
||||||
|
|
||||||
# ifdef RLIMIT_SIGPENDING
|
# ifdef RLIMIT_SIGPENDING
|
||||||
{ RLIMIT_SIGPENDING,"maxsignal", 1, "" },
|
{ RLIMIT_SIGPENDING,"maxsignal", 1, "" },
|
||||||
# endif /* RLIMIT_SIGPENDING */
|
# endif /* RLIMIT_SIGPENDING */
|
||||||
|
|
||||||
# ifdef RLIMIT_MSGQUEUE
|
# ifdef RLIMIT_MSGQUEUE
|
||||||
{ RLIMIT_MSGQUEUE, "maxmessage", 1, "" },
|
{ RLIMIT_MSGQUEUE, "maxmessage", 1, "" },
|
||||||
# endif /* RLIMIT_MSGQUEUE */
|
# endif /* RLIMIT_MSGQUEUE */
|
||||||
|
|
||||||
# ifdef RLIMIT_NICE
|
# ifdef RLIMIT_NICE
|
||||||
{ RLIMIT_NICE, "maxnice", 1, "" },
|
{ RLIMIT_NICE, "maxnice", 1, "" },
|
||||||
# endif /* RLIMIT_NICE */
|
# endif /* RLIMIT_NICE */
|
||||||
|
|
||||||
# ifdef RLIMIT_RTPRIO
|
# ifdef RLIMIT_RTPRIO
|
||||||
{ RLIMIT_RTPRIO, "maxrtprio", 1, "" },
|
{ RLIMIT_RTPRIO, "maxrtprio", 1, "" },
|
||||||
# endif /* RLIMIT_RTPRIO */
|
# endif /* RLIMIT_RTPRIO */
|
||||||
|
|
||||||
# ifdef RLIMIT_RTTIME
|
# ifdef RLIMIT_RTTIME
|
||||||
{ RLIMIT_RTTIME, "maxrttime", 1, "usec" },
|
{ RLIMIT_RTTIME, "maxrttime", 1, "usec" },
|
||||||
# endif /* RLIMIT_RTTIME */
|
# endif /* RLIMIT_RTTIME */
|
||||||
|
|
||||||
{ -1, NULL, 0, NULL }
|
{ -1, NULL, 0, NULL }
|
||||||
};
|
};
|
||||||
@ -2625,11 +2625,11 @@ iconv_catgets(nl_catd ctd, int set_id, int msg_id, const char *s)
|
|||||||
{
|
{
|
||||||
static char *buf = NULL;
|
static char *buf = NULL;
|
||||||
static size_t buf_size = 0;
|
static size_t buf_size = 0;
|
||||||
|
|
||||||
char *orig, *dest, *p;
|
char *orig, *dest, *p;
|
||||||
ICONV_CONST char *src;
|
ICONV_CONST char *src;
|
||||||
size_t src_size, dest_size;
|
size_t src_size, dest_size;
|
||||||
|
|
||||||
orig = xcatgets(ctd, set_id, msg_id, s);
|
orig = xcatgets(ctd, set_id, msg_id, s);
|
||||||
if (catgets_iconv == (iconv_t)-1 || orig == s)
|
if (catgets_iconv == (iconv_t)-1 || orig == s)
|
||||||
return orig;
|
return orig;
|
||||||
@ -2650,7 +2650,7 @@ iconv_catgets(nl_catd ctd, int set_id, int msg_id, const char *s)
|
|||||||
dest = p + (dest - buf);
|
dest = p + (dest - buf);
|
||||||
buf = p;
|
buf = p;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EILSEQ: case EINVAL: default:
|
case EILSEQ: case EINVAL: default:
|
||||||
return orig;
|
return orig;
|
||||||
}
|
}
|
||||||
@ -2735,7 +2735,7 @@ getYN(const char *prompt)
|
|||||||
xprintf("%s", prompt);
|
xprintf("%s", prompt);
|
||||||
flush();
|
flush();
|
||||||
(void) force_read(SHIN, &c, sizeof(c));
|
(void) force_read(SHIN, &c, sizeof(c));
|
||||||
/*
|
/*
|
||||||
* Perhaps we should use the yesexpr from the
|
* Perhaps we should use the yesexpr from the
|
||||||
* actual locale
|
* actual locale
|
||||||
*/
|
*/
|
||||||
|
@ -470,7 +470,7 @@ libglob(Char **vl)
|
|||||||
gflgs |= GLOB_APPEND;
|
gflgs |= GLOB_APPEND;
|
||||||
}
|
}
|
||||||
while (*++vl);
|
while (*++vl);
|
||||||
vl = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ?
|
vl = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ?
|
||||||
NULL : blk2short(globv.gl_pathv);
|
NULL : blk2short(globv.gl_pathv);
|
||||||
globfree(&globv);
|
globfree(&globv);
|
||||||
return (vl);
|
return (vl);
|
||||||
@ -522,7 +522,7 @@ globone(Char *str, int action)
|
|||||||
xfree(vl);
|
xfree(vl);
|
||||||
return (Strsave(STRNULL));
|
return (Strsave(STRNULL));
|
||||||
}
|
}
|
||||||
if (vl && vl[1])
|
if (vl && vl[1])
|
||||||
return (handleone(str, vl, action));
|
return (handleone(str, vl, action));
|
||||||
else {
|
else {
|
||||||
str = strip(*vl);
|
str = strip(*vl);
|
||||||
@ -628,7 +628,7 @@ tglob(Char **t)
|
|||||||
* use this piece of code anymore.
|
* use this piece of code anymore.
|
||||||
*/
|
*/
|
||||||
p++;
|
p++;
|
||||||
while (*p && *p != '`')
|
while (*p && *p != '`')
|
||||||
if (*p++ == '\\') {
|
if (*p++ == '\\') {
|
||||||
if (*p) /* Quoted chars */
|
if (*p) /* Quoted chars */
|
||||||
p++;
|
p++;
|
||||||
@ -643,7 +643,7 @@ tglob(Char **t)
|
|||||||
gflag |= G_CSH;
|
gflag |= G_CSH;
|
||||||
else if (isglob(*p))
|
else if (isglob(*p))
|
||||||
gflag |= G_GLOB;
|
gflag |= G_GLOB;
|
||||||
else if (symlinks == SYM_EXPAND &&
|
else if (symlinks == SYM_EXPAND &&
|
||||||
p[1] && ISDOTDOT(p) && (p == *(t-1) || *(p-1) == '/') )
|
p[1] && ISDOTDOT(p) && (p == *(t-1) || *(p-1) == '/') )
|
||||||
gflag |= G_CSH;
|
gflag |= G_CSH;
|
||||||
p++;
|
p++;
|
||||||
@ -777,7 +777,7 @@ backeval(struct blk_buf *bb, struct Strbuf *word, Char *cp, int literal)
|
|||||||
|
|
||||||
(void) setexit();
|
(void) setexit();
|
||||||
justpr = 0;
|
justpr = 0;
|
||||||
|
|
||||||
if (haderr) {
|
if (haderr) {
|
||||||
/* unwind */
|
/* unwind */
|
||||||
doneinp = 0;
|
doneinp = 0;
|
||||||
@ -911,7 +911,7 @@ Gnmatch(const Char *string, const Char *pattern, const Char **endstr)
|
|||||||
|
|
||||||
if (endstr == NULL)
|
if (endstr == NULL)
|
||||||
/* Exact matches only */
|
/* Exact matches only */
|
||||||
for (p = *fblk; *p; p++)
|
for (p = *fblk; *p; p++)
|
||||||
gres |= t_pmatch(string, *p, &tstring, 1) == 2 ? 1 : 0;
|
gres |= t_pmatch(string, *p, &tstring, 1) == 2 ? 1 : 0;
|
||||||
else {
|
else {
|
||||||
const Char *end;
|
const Char *end;
|
||||||
@ -929,10 +929,10 @@ Gnmatch(const Char *string, const Char *pattern, const Char **endstr)
|
|||||||
|
|
||||||
cleanup_until(fblk);
|
cleanup_until(fblk);
|
||||||
return(gres == gpol);
|
return(gres == gpol);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* t_pmatch():
|
/* t_pmatch():
|
||||||
* Return 2 on exact match,
|
* Return 2 on exact match,
|
||||||
* Return 1 on substring match.
|
* Return 1 on substring match.
|
||||||
* Return 0 on no match.
|
* Return 0 on no match.
|
||||||
* *estr will point to the end of the longest exact or substring match.
|
* *estr will point to the end of the longest exact or substring match.
|
||||||
@ -1002,7 +1002,7 @@ t_pmatch(const Char *string, const Char *pattern, const Char **estr, int cs)
|
|||||||
match = (globcharcoll(stringc, rangec2, 0) <= 0 &&
|
match = (globcharcoll(stringc, rangec2, 0) <= 0 &&
|
||||||
globcharcoll(rangec, stringc, 0) <= 0);
|
globcharcoll(rangec, stringc, 0) <= 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
match = (stringc == rangec);
|
match = (stringc == rangec);
|
||||||
}
|
}
|
||||||
if (rangec == '\0')
|
if (rangec == '\0')
|
||||||
|
@ -83,11 +83,11 @@ typedef unsigned long intptr_t;
|
|||||||
*/
|
*/
|
||||||
#if defined(_POSIX_SOURCE) && !defined(POSIX)
|
#if defined(_POSIX_SOURCE) && !defined(POSIX)
|
||||||
# define POSIX
|
# define POSIX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(POSIXJOBS) && !defined(BSDJOBS)
|
#if defined(POSIXJOBS) && !defined(BSDJOBS)
|
||||||
# define BSDJOBS
|
# define BSDJOBS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TMP_TEMPLATE ".XXXXXX"
|
#define TMP_TEMPLATE ".XXXXXX"
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ static __inline void tcsh_ignore(intptr_t a)
|
|||||||
|
|
||||||
#ifdef PROF
|
#ifdef PROF
|
||||||
#define xexit(n) done(n)
|
#define xexit(n) done(n)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef cray
|
#ifdef cray
|
||||||
# define word word_t /* sys/types.h defines word.. bad move! */
|
# define word word_t /* sys/types.h defines word.. bad move! */
|
||||||
@ -221,9 +221,9 @@ static __inline void tcsh_ignore(intptr_t a)
|
|||||||
|
|
||||||
#ifdef cray
|
#ifdef cray
|
||||||
# undef word
|
# undef word
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Path separator in environment variables
|
* Path separator in environment variables
|
||||||
*/
|
*/
|
||||||
#ifndef PATHSEP
|
#ifndef PATHSEP
|
||||||
@ -248,7 +248,7 @@ typedef long tcsh_number_t;
|
|||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This macro compares the st_dev field of struct stat. On aix on ibmESA
|
* This macro compares the st_dev field of struct stat. On aix on ibmESA
|
||||||
* st_dev is a structure, so comparison does not work.
|
* st_dev is a structure, so comparison does not work.
|
||||||
*/
|
*/
|
||||||
#ifndef DEV_DEV_COMPARE
|
#ifndef DEV_DEV_COMPARE
|
||||||
# define DEV_DEV_COMPARE(x,y) ((x) == (y))
|
# define DEV_DEV_COMPARE(x,y) ((x) == (y))
|
||||||
@ -359,7 +359,7 @@ typedef long tcsh_number_t;
|
|||||||
# define CSWTCH _POSIX_VDISABLE /* So job control works */
|
# define CSWTCH _POSIX_VDISABLE /* So job control works */
|
||||||
# endif /* SYSVREL > 3 */
|
# endif /* SYSVREL > 3 */
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(__DGUX__) && defined(POSIX)) || defined(DGUX)
|
#if (defined(__DGUX__) && defined(POSIX)) || defined(DGUX)
|
||||||
#undef CSWTCH
|
#undef CSWTCH
|
||||||
@ -376,7 +376,7 @@ typedef long tcsh_number_t;
|
|||||||
|
|
||||||
#if !defined(O_RDONLY) || !defined(O_NDELAY)
|
#if !defined(O_RDONLY) || !defined(O_NDELAY)
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -484,7 +484,7 @@ typedef union {
|
|||||||
# define free lint_free
|
# define free lint_free
|
||||||
# define realloc lint_realloc
|
# define realloc lint_realloc
|
||||||
# define calloc lint_calloc
|
# define calloc lint_calloc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SYSMALLOC
|
#ifdef SYSMALLOC
|
||||||
# define xmalloc(i) smalloc(i)
|
# define xmalloc(i) smalloc(i)
|
||||||
@ -637,7 +637,7 @@ EXTERN pid_t backpid; /* pid of the last background job */
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Ideally these should be uid_t, gid_t, pid_t. I cannot do that right now
|
* Ideally these should be uid_t, gid_t, pid_t. I cannot do that right now
|
||||||
* cause pid's could be unsigned and that would break our -1 flag, and
|
* cause pid's could be unsigned and that would break our -1 flag, and
|
||||||
* uid_t and gid_t are not defined in all the systems so I would have to
|
* uid_t and gid_t are not defined in all the systems so I would have to
|
||||||
* make special cases for them. In the future...
|
* make special cases for them. In the future...
|
||||||
*/
|
*/
|
||||||
@ -666,7 +666,7 @@ EXTERN int OLDSTD IZERO; /* Old standard input (def for cmds) */
|
|||||||
|
|
||||||
|
|
||||||
#if (SYSVREL == 4 && defined(_UTS)) || defined(__linux__)
|
#if (SYSVREL == 4 && defined(_UTS)) || defined(__linux__)
|
||||||
/*
|
/*
|
||||||
* From: fadden@uts.amdahl.com (Andy McFadden)
|
* From: fadden@uts.amdahl.com (Andy McFadden)
|
||||||
* we need sigsetjmp for UTS4, but not UTS2.1
|
* we need sigsetjmp for UTS4, but not UTS2.1
|
||||||
*/
|
*/
|
||||||
@ -887,14 +887,14 @@ struct command {
|
|||||||
unsigned char t_nice; /* Nice value */
|
unsigned char t_nice; /* Nice value */
|
||||||
#ifdef apollo
|
#ifdef apollo
|
||||||
unsigned char t_systype; /* System environment */
|
unsigned char t_systype; /* System environment */
|
||||||
#endif
|
#endif
|
||||||
unsigned long t_dflg; /* Flags, e.g. F_AMPERSAND|... */
|
unsigned long t_dflg; /* Flags, e.g. F_AMPERSAND|... */
|
||||||
/* save these when re-doing */
|
/* save these when re-doing */
|
||||||
#ifndef apollo
|
#ifndef apollo
|
||||||
#define F_SAVE (F_NICE|F_TIME|F_NOHUP|F_HUP)
|
#define F_SAVE (F_NICE|F_TIME|F_NOHUP|F_HUP)
|
||||||
#else
|
#else
|
||||||
#define F_SAVE (F_NICE|F_TIME|F_NOHUP||F_HUP|F_VER)
|
#define F_SAVE (F_NICE|F_TIME|F_NOHUP||F_HUP|F_VER)
|
||||||
#endif
|
#endif
|
||||||
#define F_AMPERSAND (1<<0) /* executes in background */
|
#define F_AMPERSAND (1<<0) /* executes in background */
|
||||||
#define F_APPEND (1<<1) /* output is redirected >> */
|
#define F_APPEND (1<<1) /* output is redirected >> */
|
||||||
#define F_PIPEIN (1<<2) /* input is a pipe */
|
#define F_PIPEIN (1<<2) /* input is a pipe */
|
||||||
@ -913,7 +913,7 @@ struct command {
|
|||||||
#define F_HUP (1<<15) /* hup this command */
|
#define F_HUP (1<<15) /* hup this command */
|
||||||
#ifdef apollo
|
#ifdef apollo
|
||||||
#define F_VER (1<<16) /* execute command under SYSTYPE */
|
#define F_VER (1<<16) /* execute command under SYSTYPE */
|
||||||
#endif
|
#endif
|
||||||
union {
|
union {
|
||||||
Char *T_dlef; /* Input redirect word */
|
Char *T_dlef; /* Input redirect word */
|
||||||
struct command *T_dcar; /* Left part of list/pipe */
|
struct command *T_dcar; /* Left part of list/pipe */
|
||||||
@ -1154,7 +1154,7 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
|
|||||||
#define Strsave(a) s_strsave(a)
|
#define Strsave(a) s_strsave(a)
|
||||||
#define Strend(a) s_strend(a)
|
#define Strend(a) s_strend(a)
|
||||||
#define Strstr(a, b) s_strstr(a, b)
|
#define Strstr(a, b) s_strstr(a, b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TCSH_MODIFIERS "ehlqrstuxQ"
|
#define TCSH_MODIFIERS "ehlqrstuxQ"
|
||||||
|
|
||||||
@ -1193,7 +1193,7 @@ EXTERN Char *STR_SHELLPATH;
|
|||||||
|
|
||||||
#ifdef _PATH_BSHELL
|
#ifdef _PATH_BSHELL
|
||||||
EXTERN Char *STR_BSHELL;
|
EXTERN Char *STR_BSHELL;
|
||||||
#endif
|
#endif
|
||||||
EXTERN Char *STR_WORD_CHARS;
|
EXTERN Char *STR_WORD_CHARS;
|
||||||
EXTERN Char *STR_WORD_CHARS_VI;
|
EXTERN Char *STR_WORD_CHARS_VI;
|
||||||
EXTERN Char **STR_environ IZERO;
|
EXTERN Char **STR_environ IZERO;
|
||||||
@ -1250,7 +1250,7 @@ EXTERN nl_catd catd;
|
|||||||
# else
|
# else
|
||||||
# define CGETS(b, c, d) d
|
# define CGETS(b, c, d) d
|
||||||
# define CSAVS(b, c, d) d
|
# define CSAVS(b, c, d) d
|
||||||
# endif
|
# endif
|
||||||
#else /* WINNT_NATIVE */
|
#else /* WINNT_NATIVE */
|
||||||
# define CGETS(b, c, d) nt_cgets( b, c, d)
|
# define CGETS(b, c, d) nt_cgets( b, c, d)
|
||||||
# define CSAVS(b, c, d) strsave(CGETS(b, c, d))
|
# define CSAVS(b, c, d) strsave(CGETS(b, c, d))
|
||||||
|
@ -205,25 +205,35 @@ addWordToHash(struct hashValue *h, const Char *word)
|
|||||||
{
|
{
|
||||||
uint32_t a = h->a, b = h->b, c = h->c;
|
uint32_t a = h->a, b = h->b, c = h->c;
|
||||||
#ifdef SHORT_STRINGS
|
#ifdef SHORT_STRINGS
|
||||||
|
#define GETK if ((k = (uChar)*word++) == 0) break
|
||||||
#ifdef WIDE_STRINGS
|
#ifdef WIDE_STRINGS
|
||||||
assert(sizeof(Char) >= 4);
|
assert(sizeof(Char) >= 4);
|
||||||
while (1) {
|
while (1) {
|
||||||
unsigned k;
|
unsigned k;
|
||||||
if ((k = (uChar)*word++) == 0) break; a += k;
|
GETK;
|
||||||
if ((k = (uChar)*word++) == 0) break; b += k;
|
a += k;
|
||||||
if ((k = (uChar)*word++) == 0) break; c += k;
|
GETK;
|
||||||
|
b += k;
|
||||||
|
GETK;
|
||||||
|
c += k;
|
||||||
mix(a, b, c);
|
mix(a, b, c);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
assert(sizeof(Char) == 2);
|
assert(sizeof(Char) == 2);
|
||||||
while (1) {
|
while (1) {
|
||||||
unsigned k;
|
unsigned k;
|
||||||
if ((k = (uChar)*word++) == 0) break; a += k;
|
GETK;
|
||||||
if ((k = (uChar)*word++) == 0) break; a += k << 16;
|
a += k;
|
||||||
if ((k = (uChar)*word++) == 0) break; b += k;
|
GETK;
|
||||||
if ((k = (uChar)*word++) == 0) break; b += k << 16;
|
a += k << 16;
|
||||||
if ((k = (uChar)*word++) == 0) break; c += k;
|
GETK;
|
||||||
if ((k = (uChar)*word++) == 0) break; c += k << 16;
|
b += k;
|
||||||
|
GETK;
|
||||||
|
b += k << 16;
|
||||||
|
GETK;
|
||||||
|
c += k;
|
||||||
|
GETK;
|
||||||
|
c += k << 16;
|
||||||
mix(a, b, c);
|
mix(a, b, c);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1054,9 +1064,9 @@ phist(struct Hist *hp, int hflg)
|
|||||||
output_raw = 1;
|
output_raw = 1;
|
||||||
cleanup_push(&old_output_raw, output_raw_restore);
|
cleanup_push(&old_output_raw, output_raw_restore);
|
||||||
if (hflg & HIST_TIME)
|
if (hflg & HIST_TIME)
|
||||||
/*
|
/*
|
||||||
* Make file entry with history time in format:
|
* Make file entry with history time in format:
|
||||||
* "+NNNNNNNNNN" (10 digits, left padded with ascii '0')
|
* "+NNNNNNNNNN" (10 digits, left padded with ascii '0')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
xprintf("#+%010lu\n", (unsigned long)hp->Htime);
|
xprintf("#+%010lu\n", (unsigned long)hp->Htime);
|
||||||
@ -1216,18 +1226,20 @@ dotlock_cleanup(void* lockpath)
|
|||||||
|
|
||||||
/* Save history before exiting the shell. */
|
/* Save history before exiting the shell. */
|
||||||
void
|
void
|
||||||
rechist(Char *fname, int ref)
|
rechist(Char *xfname, int ref)
|
||||||
{
|
{
|
||||||
Char *snum, *rs;
|
Char *snum, *rs;
|
||||||
int fp, ftmp, oldidfds, ophup_disabled;
|
int fp, ftmp, oldidfds, ophup_disabled;
|
||||||
struct varent *shist;
|
struct varent *shist;
|
||||||
char path[MAXPATHLEN];
|
char path[MAXPATHLEN];
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
static Char *fname;
|
||||||
static Char *dumphist[] = {STRhistory, STRmhT, 0, 0};
|
static Char *dumphist[] = {STRhistory, STRmhT, 0, 0};
|
||||||
|
|
||||||
if (fname == NULL && !ref)
|
if (fname == NULL && !ref)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
fname = xfname;
|
||||||
ophup_disabled = phup_disabled;
|
ophup_disabled = phup_disabled;
|
||||||
phup_disabled = 1;
|
phup_disabled = 1;
|
||||||
|
|
||||||
@ -1253,8 +1265,8 @@ rechist(Char *fname, int ref)
|
|||||||
/*
|
/*
|
||||||
* The 'savehist merge' feature is intended for an environment
|
* The 'savehist merge' feature is intended for an environment
|
||||||
* with numerous shells being in simultaneous use. Imagine
|
* with numerous shells being in simultaneous use. Imagine
|
||||||
* any kind of window system. All these shells 'share' the same
|
* any kind of window system. All these shells 'share' the same
|
||||||
* ~/.history file for recording their command line history.
|
* ~/.history file for recording their command line history.
|
||||||
* We try to handle the case of multiple shells trying to merge
|
* We try to handle the case of multiple shells trying to merge
|
||||||
* histories at the same time, by creating semi-unique filenames
|
* histories at the same time, by creating semi-unique filenames
|
||||||
* and saving the history there first and then trying to rename
|
* and saving the history there first and then trying to rename
|
||||||
@ -1265,7 +1277,7 @@ rechist(Char *fname, int ref)
|
|||||||
* by optional lock parameter to savehist.
|
* by optional lock parameter to savehist.
|
||||||
*
|
*
|
||||||
* jw.
|
* jw.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* We need the didfds stuff before loadhist otherwise
|
* We need the didfds stuff before loadhist otherwise
|
||||||
* exec in a script will fail to print if merge is set.
|
* exec in a script will fail to print if merge is set.
|
||||||
@ -1331,7 +1343,7 @@ rechist(Char *fname, int ref)
|
|||||||
#ifndef WINNT_NATIVE
|
#ifndef WINNT_NATIVE
|
||||||
(void)rename(path, short2str(fname));
|
(void)rename(path, short2str(fname));
|
||||||
#else
|
#else
|
||||||
(void)ReplaceFile( short2str(fname),path,NULL,0,NULL,NULL);
|
(void)ReplaceFile(short2str(fname), path, NULL, 0, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
cleanup_until(fname);
|
cleanup_until(fname);
|
||||||
phup_disabled = ophup_disabled;
|
phup_disabled = ophup_disabled;
|
||||||
|
@ -205,7 +205,7 @@ int nsrchn = sizeof srchn / sizeof *srchn;
|
|||||||
/*
|
/*
|
||||||
* Note: For some machines, (hpux eg.)
|
* Note: For some machines, (hpux eg.)
|
||||||
* NSIG = number of signals + 1...
|
* NSIG = number of signals + 1...
|
||||||
* so we define 33 or 65 (POSIX) signals for
|
* so we define 33 or 65 (POSIX) signals for
|
||||||
* everybody
|
* everybody
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ mesginit(void)
|
|||||||
|
|
||||||
#ifdef SIGHUP
|
#ifdef SIGHUP
|
||||||
if (mesg[SIGHUP].pname == NULL) {
|
if (mesg[SIGHUP].pname == NULL) {
|
||||||
mesg[SIGHUP].iname = "HUP";
|
mesg[SIGHUP].iname = "HUP";
|
||||||
mesg[SIGHUP].pname = CSAVS(2, 2, "Hangup");
|
mesg[SIGHUP].pname = CSAVS(2, 2, "Hangup");
|
||||||
}
|
}
|
||||||
#endif /* SIGHUP */
|
#endif /* SIGHUP */
|
||||||
@ -550,7 +550,7 @@ mesginit(void)
|
|||||||
/* _CRAYCOM */
|
/* _CRAYCOM */
|
||||||
if (mesg[SIGTHERR].pname == NULL) {
|
if (mesg[SIGTHERR].pname == NULL) {
|
||||||
mesg[SIGTHERR].iname = "THERR";
|
mesg[SIGTHERR].iname = "THERR";
|
||||||
mesg[SIGTHERR].pname = CSAVS(2, 43,
|
mesg[SIGTHERR].pname = CSAVS(2, 43,
|
||||||
"Thread error - (use cord -T for detailed info)");
|
"Thread error - (use cord -T for detailed info)");
|
||||||
}
|
}
|
||||||
#endif /* SIGTHERR */
|
#endif /* SIGTHERR */
|
||||||
@ -730,7 +730,7 @@ mesginit(void)
|
|||||||
/* solaris */
|
/* solaris */
|
||||||
if (mesg[SIGCANCEL].pname == NULL) {
|
if (mesg[SIGCANCEL].pname == NULL) {
|
||||||
mesg[SIGCANCEL].iname = "CANCEL";
|
mesg[SIGCANCEL].iname = "CANCEL";
|
||||||
mesg[SIGCANCEL].pname = CSAVS(2, 109,
|
mesg[SIGCANCEL].pname = CSAVS(2, 109,
|
||||||
"Thread cancellation signal used by libthread");
|
"Thread cancellation signal used by libthread");
|
||||||
}
|
}
|
||||||
#endif /* SIGCANCEL */
|
#endif /* SIGCANCEL */
|
||||||
@ -738,11 +738,11 @@ mesginit(void)
|
|||||||
/*
|
/*
|
||||||
* Careful, some OS's (HP/UX 10.0) define these as -1
|
* Careful, some OS's (HP/UX 10.0) define these as -1
|
||||||
*/
|
*/
|
||||||
#ifdef SIGRTMIN
|
#ifdef SIGRTMIN
|
||||||
/*
|
/*
|
||||||
* Cannot do this at compile time; Solaris2 uses _sysconf for these
|
* Cannot do this at compile time; Solaris2 uses _sysconf for these
|
||||||
*/
|
*/
|
||||||
if (SIGRTMIN > 0 && SIGRTMIN < NUMSIG) {
|
if (SIGRTMIN > 0 && SIGRTMIN < NUMSIG) {
|
||||||
if (mesg[SIGRTMIN].pname == NULL) {
|
if (mesg[SIGRTMIN].pname == NULL) {
|
||||||
mesg[SIGRTMIN].iname = "RTMIN";
|
mesg[SIGRTMIN].iname = "RTMIN";
|
||||||
mesg[SIGRTMIN].pname = CSAVS(2, 68, "First Realtime Signal");
|
mesg[SIGRTMIN].pname = CSAVS(2, 68, "First Realtime Signal");
|
||||||
|
@ -333,7 +333,7 @@ word(int parsehtime)
|
|||||||
} while (c != '\n');
|
} while (c != '\n');
|
||||||
if (parsehtime) {
|
if (parsehtime) {
|
||||||
hbuf[11] = '\0';
|
hbuf[11] = '\0';
|
||||||
Htime = a2time_t(hbuf);
|
Htime = a2time_t(hbuf);
|
||||||
}
|
}
|
||||||
if (c1 == '\\')
|
if (c1 == '\\')
|
||||||
goto loop;
|
goto loop;
|
||||||
@ -885,7 +885,7 @@ getsub(struct wordent *en)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* From Beto Appleton (beto@aixwiz.austin.ibm.com)
|
* From Beto Appleton (beto@aixwiz.austin.ibm.com)
|
||||||
*
|
*
|
||||||
* when using history substitution, and the variable
|
* when using history substitution, and the variable
|
||||||
@ -946,7 +946,7 @@ dosub(Char sc, struct wordent *en, int global)
|
|||||||
if (didsub == 0)
|
if (didsub == 0)
|
||||||
seterror(ERR_MODFAIL);
|
seterror(ERR_MODFAIL);
|
||||||
hp->prev = wdp;
|
hp->prev = wdp;
|
||||||
/*
|
/*
|
||||||
* ANSI mode HP/UX compiler chokes on
|
* ANSI mode HP/UX compiler chokes on
|
||||||
* return &enthist(HIST_PURGE, &lexi, 0)->Hlex;
|
* return &enthist(HIST_PURGE, &lexi, 0)->Hlex;
|
||||||
*/
|
*/
|
||||||
@ -994,7 +994,7 @@ subword(Char *cp, Char type, int *adid, size_t *start_pos)
|
|||||||
case '\\':
|
case '\\':
|
||||||
if (np[1] == '&')
|
if (np[1] == '&')
|
||||||
np++;
|
np++;
|
||||||
/* fall into ... */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Strbuf_append1(&wbuf, *np);
|
Strbuf_append1(&wbuf, *np);
|
||||||
@ -1205,7 +1205,7 @@ gethent(Char sc)
|
|||||||
case '-':
|
case '-':
|
||||||
back = 1;
|
back = 1;
|
||||||
c = getC(0);
|
c = getC(0);
|
||||||
/* FALLSTHROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (any("(=~", c)) {
|
if (any("(=~", c)) {
|
||||||
@ -1579,9 +1579,9 @@ wide_read(int fildes, Char *buf, size_t nchars, int use_fclens)
|
|||||||
|
|
||||||
if (partial + len >= sizeof(cbuf) / sizeof(*cbuf))
|
if (partial + len >= sizeof(cbuf) / sizeof(*cbuf))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
r = xread(fildes, cbuf + partial, len);
|
r = xread(fildes, cbuf + partial, len);
|
||||||
|
|
||||||
if (partial == 0 && r <= 0)
|
if (partial == 0 && r <= 0)
|
||||||
break;
|
break;
|
||||||
partial += r;
|
partial += r;
|
||||||
@ -1755,7 +1755,7 @@ bseek(struct Ain *l)
|
|||||||
xprintf(CGETS(16, 5, "seek to alias %x %x\n"), alvec, alvecp);
|
xprintf(CGETS(16, 5, "seek to alias %x %x\n"), alvec, alvecp);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
case TCSH_F_SEEK:
|
case TCSH_F_SEEK:
|
||||||
#ifdef DEBUG_SEEK
|
#ifdef DEBUG_SEEK
|
||||||
xprintf(CGETS(16, 6, "seek to file %x\n"), fseekp);
|
xprintf(CGETS(16, 6, "seek to file %x\n"), fseekp);
|
||||||
#endif
|
#endif
|
||||||
|
@ -270,7 +270,7 @@ closem(void)
|
|||||||
num_files = NOFILE;
|
num_files = NOFILE;
|
||||||
for (f = 0; f < num_files; f++)
|
for (f = 0; f < num_files; f++)
|
||||||
if (f != SHIN && f != SHOUT && f != SHDIAG && f != OLDSTD &&
|
if (f != SHIN && f != SHOUT && f != SHDIAG && f != OLDSTD &&
|
||||||
f != FSHTTY
|
f != FSHTTY
|
||||||
#ifdef MALLOC_TRACE
|
#ifdef MALLOC_TRACE
|
||||||
&& f != 25
|
&& f != 25
|
||||||
#endif /* MALLOC_TRACE */
|
#endif /* MALLOC_TRACE */
|
||||||
@ -282,7 +282,7 @@ closem(void)
|
|||||||
* Not closing sockets does not make the cleanup use of closem()
|
* Not closing sockets does not make the cleanup use of closem()
|
||||||
* less reliable because tcsh never creates sockets.
|
* less reliable because tcsh never creates sockets.
|
||||||
*/
|
*/
|
||||||
&& fstat(f, &st) == 0 && !S_ISSOCK(st.st_mode)
|
&& fstat(f, &st) == 0 && !S_ISSOCK(st.st_mode)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -342,7 +342,7 @@ donefds(void)
|
|||||||
(void)dcopy(fd, 2);
|
(void)dcopy(fd, 2);
|
||||||
(void)dmove(fd, 0);
|
(void)dmove(fd, 0);
|
||||||
}
|
}
|
||||||
#endif /*NISPLUS*/
|
#endif /*NISPLUS*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -620,6 +620,7 @@ syn3(const struct wordent *p1, const struct wordent *p2, int flags)
|
|||||||
savep:
|
savep:
|
||||||
if (!specp)
|
if (!specp)
|
||||||
continue;
|
continue;
|
||||||
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
if (l != 0 && !specp)
|
if (l != 0 && !specp)
|
||||||
continue;
|
continue;
|
||||||
|
@ -95,7 +95,7 @@ pcsecs(clock_t l)
|
|||||||
p2dig((int) (l % 100));
|
p2dig((int) (l % 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
p2dig(unsigned i)
|
p2dig(unsigned i)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ putwraw(Char c)
|
|||||||
{
|
{
|
||||||
char buf[MB_LEN_MAX];
|
char buf[MB_LEN_MAX];
|
||||||
size_t i, len;
|
size_t i, len;
|
||||||
|
|
||||||
len = one_wctomb(buf, c & CHAR);
|
len = one_wctomb(buf, c & CHAR);
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
putraw((unsigned char)buf[i] | (c & ~CHAR));
|
putraw((unsigned char)buf[i] | (c & ~CHAR));
|
||||||
@ -134,7 +134,7 @@ xputwchar(Char c)
|
|||||||
{
|
{
|
||||||
char buf[MB_LEN_MAX];
|
char buf[MB_LEN_MAX];
|
||||||
size_t i, len;
|
size_t i, len;
|
||||||
|
|
||||||
len = one_wctomb(buf, c & CHAR);
|
len = one_wctomb(buf, c & CHAR);
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
xputchar((unsigned char)buf[i] | (c & ~CHAR));
|
xputchar((unsigned char)buf[i] | (c & ~CHAR));
|
||||||
|
@ -233,10 +233,10 @@ pchild(void)
|
|||||||
# define HAVEwait3
|
# define HAVEwait3
|
||||||
pid = waitpid(-1, &w,
|
pid = waitpid(-1, &w,
|
||||||
(setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG));
|
(setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG));
|
||||||
# endif /* ODT */
|
# endif /* ODT */
|
||||||
# if defined(aiws) || defined(uts)
|
# if defined(aiws) || defined(uts)
|
||||||
# define HAVEwait3
|
# define HAVEwait3
|
||||||
pid = wait3(&w.w_status,
|
pid = wait3(&w.w_status,
|
||||||
(setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), 0);
|
(setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), 0);
|
||||||
# endif /* aiws || uts */
|
# endif /* aiws || uts */
|
||||||
# ifndef HAVEwait3
|
# ifndef HAVEwait3
|
||||||
@ -245,8 +245,8 @@ pchild(void)
|
|||||||
/* on Sys V, this may hang. I hope it's not going to be a problem */
|
/* on Sys V, this may hang. I hope it's not going to be a problem */
|
||||||
pid = wait(&w);
|
pid = wait(&w);
|
||||||
# else /* BSDWAIT */
|
# else /* BSDWAIT */
|
||||||
/*
|
/*
|
||||||
* XXX: for greater than 3 we should use waitpid().
|
* XXX: for greater than 3 we should use waitpid().
|
||||||
* but then again, SVR4 falls into the POSIX/BSDJOBS category.
|
* but then again, SVR4 falls into the POSIX/BSDJOBS category.
|
||||||
*/
|
*/
|
||||||
pid = wait(&w.w_status);
|
pid = wait(&w.w_status);
|
||||||
@ -443,7 +443,7 @@ pnote(void)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
pfree(struct process *pp)
|
pfree(struct process *pp)
|
||||||
{
|
{
|
||||||
xfree(pp->p_command);
|
xfree(pp->p_command);
|
||||||
if (pp->p_cwd && --pp->p_cwd->di_count == 0)
|
if (pp->p_cwd && --pp->p_cwd->di_count == 0)
|
||||||
if (pp->p_cwd->di_next == 0)
|
if (pp->p_cwd->di_next == 0)
|
||||||
@ -568,10 +568,10 @@ pjwait(struct process *pp)
|
|||||||
fp->p_reason | META : fp->p_reason;
|
fp->p_reason | META : fp->p_reason;
|
||||||
} while ((fp = fp->p_friends) != pp);
|
} while ((fp = fp->p_friends) != pp);
|
||||||
/*
|
/*
|
||||||
* Don't report on backquoted jobs, cause it will mess up
|
* Don't report on backquoted jobs, cause it will mess up
|
||||||
* their output.
|
* their output.
|
||||||
*/
|
*/
|
||||||
if ((reason != 0) && (adrof(STRprintexitvalue)) &&
|
if ((reason != 0) && (adrof(STRprintexitvalue)) &&
|
||||||
(pp->p_flags & PBACKQ) == 0)
|
(pp->p_flags & PBACKQ) == 0)
|
||||||
xprintf(CGETS(17, 2, "Exit %d\n"), reason);
|
xprintf(CGETS(17, 2, "Exit %d\n"), reason);
|
||||||
reason_str = putn((tcsh_number_t)reason);
|
reason_str = putn((tcsh_number_t)reason);
|
||||||
@ -734,7 +734,7 @@ morecommand(size_t s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* GrP
|
/* GrP
|
||||||
* unparse - Export padd() functionality
|
* unparse - Export padd() functionality
|
||||||
*/
|
*/
|
||||||
Char *
|
Char *
|
||||||
unparse(struct command *t)
|
unparse(struct command *t)
|
||||||
@ -1015,7 +1015,7 @@ pprint(struct process *pp, int flag)
|
|||||||
if ((pp->p_friends->p_flags & PPOU) && !inpipe && (flag & NAME)) {
|
if ((pp->p_friends->p_flags & PPOU) && !inpipe && (flag & NAME)) {
|
||||||
inpipe = 1;
|
inpipe = 1;
|
||||||
pipetail = pp;
|
pipetail = pp;
|
||||||
do
|
do
|
||||||
pp = pp->p_friends;
|
pp = pp->p_friends;
|
||||||
while (pp->p_friends->p_flags & PPOU);
|
while (pp->p_friends->p_flags & PPOU);
|
||||||
pipehead = pp;
|
pipehead = pp;
|
||||||
@ -1028,7 +1028,7 @@ pprint(struct process *pp, int flag)
|
|||||||
pcond = (tp != pp || (inpipe && tp == pp));
|
pcond = (tp != pp || (inpipe && tp == pp));
|
||||||
#else /* !BACKPIPE */
|
#else /* !BACKPIPE */
|
||||||
pcond = (tp != pp);
|
pcond = (tp != pp);
|
||||||
#endif /* BACKPIPE */
|
#endif /* BACKPIPE */
|
||||||
|
|
||||||
jobflags |= pp->p_flags;
|
jobflags |= pp->p_flags;
|
||||||
pstatus = (int) (pp->p_flags & PALLSTATES);
|
pstatus = (int) (pp->p_flags & PALLSTATES);
|
||||||
@ -1822,7 +1822,7 @@ pfork(struct command *t, int wanttty)
|
|||||||
pgrp = pcurrjob ? pcurrjob->p_jobid : getpid();
|
pgrp = pcurrjob ? pcurrjob->p_jobid : getpid();
|
||||||
pflushall();
|
pflushall();
|
||||||
pcurrjob = NULL;
|
pcurrjob = NULL;
|
||||||
#if !defined(BSDTIMES) && !defined(_SEQUENT_)
|
#if !defined(BSDTIMES) && !defined(_SEQUENT_)
|
||||||
timesdone = 0;
|
timesdone = 0;
|
||||||
#endif /* !defined(BSDTIMES) && !defined(_SEQUENT_) */
|
#endif /* !defined(BSDTIMES) && !defined(_SEQUENT_) */
|
||||||
child++;
|
child++;
|
||||||
@ -1896,7 +1896,7 @@ pfork(struct command *t, int wanttty)
|
|||||||
pgrp = pcurrjob ? pcurrjob->p_jobid : pid;
|
pgrp = pcurrjob ? pcurrjob->p_jobid : pid;
|
||||||
if (setpgid(pid, pgrp) == -1 && errno == EPERM) {
|
if (setpgid(pid, pgrp) == -1 && errno == EPERM) {
|
||||||
pcurrjob = NULL;
|
pcurrjob = NULL;
|
||||||
/*
|
/*
|
||||||
* We don't care if this causes an error here;
|
* We don't care if this causes an error here;
|
||||||
* then we are already in the right process group
|
* then we are already in the right process group
|
||||||
*/
|
*/
|
||||||
@ -1965,7 +1965,7 @@ setttypgrp(int pgrp)
|
|||||||
struct sigaction old;
|
struct sigaction old;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tcsetpgrp will set SIGTTOU to all the the processes in
|
* tcsetpgrp will set SIGTTOU to all the the processes in
|
||||||
* the background according to POSIX... We ignore this here.
|
* the background according to POSIX... We ignore this here.
|
||||||
*/
|
*/
|
||||||
sigaction(SIGTTOU, NULL, &old);
|
sigaction(SIGTTOU, NULL, &old);
|
||||||
@ -1984,7 +1984,7 @@ setttypgrp(int pgrp)
|
|||||||
* if we don't have vfork(), things can still go in the wrong order
|
* if we don't have vfork(), things can still go in the wrong order
|
||||||
* resulting in the famous 'Stopped (tty output)'. But some systems
|
* resulting in the famous 'Stopped (tty output)'. But some systems
|
||||||
* don't permit the setpgid() call, (these are more recent secure
|
* don't permit the setpgid() call, (these are more recent secure
|
||||||
* systems such as ibm's aix), when they do. Then we'd rather print
|
* systems such as ibm's aix), when they do. Then we'd rather print
|
||||||
* an error message than hang the shell!
|
* an error message than hang the shell!
|
||||||
* I am open to suggestions how to fix that.
|
* I am open to suggestions how to fix that.
|
||||||
*/
|
*/
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#ifdef VFORK
|
#ifdef VFORK
|
||||||
static void vffree (int);
|
static void vffree (int);
|
||||||
#endif
|
#endif
|
||||||
static Char *splicepipe (struct command *, Char *);
|
static Char *splicepipe (struct command *, Char *);
|
||||||
static void doio (struct command *, int *, int *);
|
static void doio (struct command *, int *, int *);
|
||||||
static void chkclob (const char *);
|
static void chkclob (const char *);
|
||||||
@ -72,7 +72,7 @@ static void chkclob (const char *);
|
|||||||
* mean processes connected by '|'.) I don't know yet if this causes other
|
* mean processes connected by '|'.) I don't know yet if this causes other
|
||||||
* problems.
|
* problems.
|
||||||
*
|
*
|
||||||
* All the changes for this are in execute(), and are enclosed in
|
* All the changes for this are in execute(), and are enclosed in
|
||||||
* '#ifdef BACKPIPE'
|
* '#ifdef BACKPIPE'
|
||||||
*
|
*
|
||||||
* David Dawes (dawes@physics.su.oz.au) Oct 1991
|
* David Dawes (dawes@physics.su.oz.au) Oct 1991
|
||||||
@ -98,7 +98,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
|
|||||||
(void) &forked;
|
(void) &forked;
|
||||||
(void) &bifunc;
|
(void) &bifunc;
|
||||||
|
|
||||||
if (t == 0)
|
if (t == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef WINNT_NATIVE
|
#ifdef WINNT_NATIVE
|
||||||
@ -119,7 +119,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
|
|||||||
/*
|
/*
|
||||||
* Ed hutchins@sgi.com & Dominic dbg@sgi.com
|
* Ed hutchins@sgi.com & Dominic dbg@sgi.com
|
||||||
* Sat Feb 25 03:13:11 PST 1995
|
* Sat Feb 25 03:13:11 PST 1995
|
||||||
* try implicit cd if we have a 1 word command
|
* try implicit cd if we have a 1 word command
|
||||||
*/
|
*/
|
||||||
if (implicit_cd && (intty || intact) && t->t_dcom && t->t_dcom[0] &&
|
if (implicit_cd && (intty || intact) && t->t_dcom && t->t_dcom[0] &&
|
||||||
t->t_dcom[0][0] && (blklen(t->t_dcom) == 1) && !noexec) {
|
t->t_dcom[0][0] && (blklen(t->t_dcom) == 1) && !noexec) {
|
||||||
@ -164,7 +164,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
|
|||||||
)) {
|
)) {
|
||||||
Char *vCD[2];
|
Char *vCD[2];
|
||||||
Char **ot_dcom = t->t_dcom;
|
Char **ot_dcom = t->t_dcom;
|
||||||
|
|
||||||
vCD[0] = Strsave(STRcd);
|
vCD[0] = Strsave(STRcd);
|
||||||
vCD[1] = NULL;
|
vCD[1] = NULL;
|
||||||
t->t_dcom = blkspl(vCD, ot_dcom);
|
t->t_dcom = blkspl(vCD, ot_dcom);
|
||||||
@ -321,11 +321,11 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GrP Executing a command - run jobcmd hook
|
* GrP Executing a command - run jobcmd hook
|
||||||
* Don't run for builtins
|
* Don't run for builtins
|
||||||
* Don't run if we're not in a tty
|
* Don't run if we're not in a tty
|
||||||
* Don't run if we're not really executing
|
* Don't run if we're not really executing
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* CR - Charles Ross Aug 2005
|
* CR - Charles Ross Aug 2005
|
||||||
@ -341,7 +341,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
|
|||||||
job_cmd(cmd);
|
job_cmd(cmd);
|
||||||
cleanup_until(cmd);
|
cleanup_until(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We fork only if we are timed, or are not the end of a parenthesized
|
* We fork only if we are timed, or are not the end of a parenthesized
|
||||||
* list and not a simple builtin function. Simple meaning one that is
|
* list and not a simple builtin function. Simple meaning one that is
|
||||||
@ -752,7 +752,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Fall through for all breaks from switch
|
* Fall through for all breaks from switch
|
||||||
*
|
*
|
||||||
* If there will be no more executions of this command, flush all file
|
* If there will be no more executions of this command, flush all file
|
||||||
* descriptors. Places that turn on the F_REPEAT bit are responsible for
|
* descriptors. Places that turn on the F_REPEAT bit are responsible for
|
||||||
* doing donefds after the last re-execution
|
* doing donefds after the last re-execution
|
||||||
@ -784,7 +784,7 @@ vffree(int snum)
|
|||||||
*
|
*
|
||||||
* I don't know what is best to do. I think that Ambiguous is better
|
* I don't know what is best to do. I think that Ambiguous is better
|
||||||
* than restructuring the command vector, because the user can get
|
* than restructuring the command vector, because the user can get
|
||||||
* unexpected results. In any case, the command vector restructuring
|
* unexpected results. In any case, the command vector restructuring
|
||||||
* code is present and the user can choose it by setting noambiguous
|
* code is present and the user can choose it by setting noambiguous
|
||||||
*/
|
*/
|
||||||
static Char *
|
static Char *
|
||||||
@ -827,7 +827,7 @@ splicepipe(struct command *t, Char *cp)
|
|||||||
}
|
}
|
||||||
return(blk[0]);
|
return(blk[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform io redirection.
|
* Perform io redirection.
|
||||||
* We may or maynot be forked here.
|
* We may or maynot be forked here.
|
||||||
|
@ -61,7 +61,7 @@ static void
|
|||||||
update_vars(Char *vp)
|
update_vars(Char *vp)
|
||||||
{
|
{
|
||||||
if (eq(vp, STRpath)) {
|
if (eq(vp, STRpath)) {
|
||||||
struct varent *p = adrof(STRpath);
|
struct varent *p = adrof(STRpath);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
stderror(ERR_NAME | ERR_UNDVAR);
|
stderror(ERR_NAME | ERR_UNDVAR);
|
||||||
else {
|
else {
|
||||||
@ -183,7 +183,7 @@ update_vars(Char *vp)
|
|||||||
numeof = numeof * 10 + *cp - '0';
|
numeof = numeof * 10 + *cp - '0';
|
||||||
}
|
}
|
||||||
if (numeof <= 0) numeof = 26; /* Sanity check */
|
if (numeof <= 0) numeof = 26; /* Sanity check */
|
||||||
}
|
}
|
||||||
else if (eq(vp, STRbackslash_quote)) {
|
else if (eq(vp, STRbackslash_quote)) {
|
||||||
bslash_quote = 1;
|
bslash_quote = 1;
|
||||||
}
|
}
|
||||||
@ -611,7 +611,7 @@ adrof1(const Char *name, struct varent *v)
|
|||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
v = v->v_left;
|
v = v->v_left;
|
||||||
while (v && ((cmp = *name - *v->v_name) != 0 ||
|
while (v && ((cmp = *name - *v->v_name) != 0 ||
|
||||||
(cmp = Strcmp(name, v->v_name)) != 0))
|
(cmp = Strcmp(name, v->v_name)) != 0))
|
||||||
if (cmp < 0)
|
if (cmp < 0)
|
||||||
v = v->v_left;
|
v = v->v_left;
|
||||||
@ -702,7 +702,7 @@ set1(const Char *var, Char **vec, struct varent *head, int flags)
|
|||||||
}
|
}
|
||||||
/* Compress items - remove empty items */
|
/* Compress items - remove empty items */
|
||||||
for (j = i = 0; i < num_items; i++)
|
for (j = i = 0; i < num_items; i++)
|
||||||
if (vec[i])
|
if (vec[i])
|
||||||
vec[j++] = vec[i];
|
vec[j++] = vec[i];
|
||||||
|
|
||||||
/* NULL-fy remaining items */
|
/* NULL-fy remaining items */
|
||||||
@ -711,7 +711,7 @@ set1(const Char *var, Char **vec, struct varent *head, int flags)
|
|||||||
}
|
}
|
||||||
/* don't let the attribute propagate */
|
/* don't let the attribute propagate */
|
||||||
flags &= ~(VAR_FIRST|VAR_LAST);
|
flags &= ~(VAR_FIRST|VAR_LAST);
|
||||||
}
|
}
|
||||||
setq(var, vec, head, flags);
|
setq(var, vec, head, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1153,7 +1153,7 @@ update_dspmbyte_vars(void)
|
|||||||
int lp, iskcode;
|
int lp, iskcode;
|
||||||
Char *dstr1;
|
Char *dstr1;
|
||||||
struct varent *vp;
|
struct varent *vp;
|
||||||
|
|
||||||
/* if variable "nokanji" is set, multi-byte display is disabled */
|
/* if variable "nokanji" is set, multi-byte display is disabled */
|
||||||
if ((vp = adrof(CHECK_MBYTEVAR)) && !adrof(STRnokanji)) {
|
if ((vp = adrof(CHECK_MBYTEVAR)) && !adrof(STRnokanji)) {
|
||||||
_enable_mbdisp = 1;
|
_enable_mbdisp = 1;
|
||||||
@ -1306,7 +1306,7 @@ autoset_dspmbyte(const Char *pcp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (*pcp == '\0')
|
if (*pcp == '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1324,7 +1324,7 @@ void
|
|||||||
autoset_kanji(void)
|
autoset_kanji(void)
|
||||||
{
|
{
|
||||||
char *codeset = nl_langinfo(CODESET);
|
char *codeset = nl_langinfo(CODESET);
|
||||||
|
|
||||||
if (*codeset == '\0') {
|
if (*codeset == '\0') {
|
||||||
if (adrof(STRnokanji) == NULL)
|
if (adrof(STRnokanji) == NULL)
|
||||||
setNS(STRnokanji);
|
setNS(STRnokanji);
|
||||||
|
@ -353,9 +353,9 @@ prusage(struct tms *bs, struct tms *es, clock_t e, clock_t b)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* the tms stuff is not very precise, so we fudge it.
|
* the tms stuff is not very precise, so we fudge it.
|
||||||
* granularity fix: can't be more than 100%
|
* granularity fix: can't be more than 100%
|
||||||
* this breaks in multi-processor systems...
|
* this breaks in multi-processor systems...
|
||||||
* maybe I should take it out and let people see more then 100%
|
* maybe I should take it out and let people see more then 100%
|
||||||
* utilizations.
|
* utilizations.
|
||||||
*/
|
*/
|
||||||
# if 0
|
# if 0
|
||||||
@ -447,7 +447,7 @@ prusage(struct tms *bs, struct tms *es, clock_t e, clock_t b)
|
|||||||
#endif
|
#endif
|
||||||
xprintf("%ld", i);
|
xprintf("%ld", i);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef convex
|
#ifdef convex
|
||||||
case 'X': /* (average) shared text size */
|
case 'X': /* (average) shared text size */
|
||||||
memtmp = (t == 0 ? 0LL : IADJUST((long long)r1->ru_ixrss -
|
memtmp = (t == 0 ? 0LL : IADJUST((long long)r1->ru_ixrss -
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* dependent, even between different revisions of OS's...
|
* dependent, even between different revisions of OS's...
|
||||||
* Ideally there should be a way in c, to find out if something
|
* Ideally there should be a way in c, to find out if something
|
||||||
* was typedef'ed, but unfortunately we rely in cpp kludges.
|
* was typedef'ed, but unfortunately we rely in cpp kludges.
|
||||||
* Someday, this file will be removed...
|
* Someday, this file will be removed...
|
||||||
*
|
*
|
||||||
* christos
|
* christos
|
||||||
*/
|
*/
|
||||||
/*-
|
/*-
|
||||||
@ -51,7 +51,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** MachTen
|
*** MachTen
|
||||||
***/
|
***/
|
||||||
#ifdef __MACHTEN__
|
#ifdef __MACHTEN__
|
||||||
# ifndef _PID_T
|
# ifndef _PID_T
|
||||||
@ -65,7 +65,7 @@
|
|||||||
***/
|
***/
|
||||||
#if (defined(sun) || defined(__sun__)) && SYSVREL == 0
|
#if (defined(sun) || defined(__sun__)) && SYSVREL == 0
|
||||||
# ifndef _PTR_T
|
# ifndef _PTR_T
|
||||||
# define _PTR_T
|
# define _PTR_T
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
typedef void * ptr_t;
|
typedef void * ptr_t;
|
||||||
# else
|
# else
|
||||||
@ -94,7 +94,7 @@
|
|||||||
#ifdef __hpux
|
#ifdef __hpux
|
||||||
|
|
||||||
# ifndef _PTR_T
|
# ifndef _PTR_T
|
||||||
# define _PTR_T
|
# define _PTR_T
|
||||||
typedef void * ptr_t;
|
typedef void * ptr_t;
|
||||||
# endif /* _PTR_T */
|
# endif /* _PTR_T */
|
||||||
|
|
||||||
@ -152,23 +152,23 @@ typedef char * caddr_t;
|
|||||||
|
|
||||||
/***
|
/***
|
||||||
*** BSD RENO advertises itself as POSIX, but
|
*** BSD RENO advertises itself as POSIX, but
|
||||||
*** it is missing speed_t
|
*** it is missing speed_t
|
||||||
***/
|
***/
|
||||||
#ifdef RENO
|
#ifdef RENO
|
||||||
# ifndef _SPEED_T
|
# ifndef _SPEED_T
|
||||||
# define _SPEED_T
|
# define _SPEED_T
|
||||||
typedef unsigned int speed_t;
|
typedef unsigned int speed_t;
|
||||||
# endif /* _SPEED_T */
|
# endif /* _SPEED_T */
|
||||||
#endif /* RENO */
|
#endif /* RENO */
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** NeXT OS 3.x
|
*** NeXT OS 3.x
|
||||||
***/
|
***/
|
||||||
#ifdef NeXT
|
#ifdef NeXT
|
||||||
# ifndef _SPEED_T
|
# ifndef _SPEED_T
|
||||||
# define _SPEED_T
|
# define _SPEED_T
|
||||||
typedef unsigned int speed_t;
|
typedef unsigned int speed_t;
|
||||||
# endif /* _SPEED_T */
|
# endif /* _SPEED_T */
|
||||||
#endif /* NeXT */
|
#endif /* NeXT */
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ typedef char * caddr_t;
|
|||||||
# endif /* _PID_T */
|
# endif /* _PID_T */
|
||||||
# endif /* !aiws */
|
# endif /* !aiws */
|
||||||
# ifdef _IBMR2
|
# ifdef _IBMR2
|
||||||
# ifndef _SPEED_T
|
# ifndef _SPEED_T
|
||||||
# define _SPEED_T
|
# define _SPEED_T
|
||||||
# endif /* _SPEED_T */
|
# endif /* _SPEED_T */
|
||||||
# endif /* _IBMR2 */
|
# endif /* _IBMR2 */
|
||||||
@ -246,7 +246,7 @@ typedef char * caddr_t;
|
|||||||
#endif /* OREO */
|
#endif /* OREO */
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0.
|
*** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0.
|
||||||
**** [RTU 6.0 from mike connor]
|
**** [RTU 6.0 from mike connor]
|
||||||
*** Added, DAS DEC-90.
|
*** Added, DAS DEC-90.
|
||||||
***/
|
***/
|
||||||
@ -261,7 +261,7 @@ typedef char * caddr_t;
|
|||||||
#endif /* RTU6 */
|
#endif /* RTU6 */
|
||||||
#endif /* masscomp */
|
#endif /* masscomp */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Motorola MPC running R32V2 (sysV88)
|
* Motorola MPC running R32V2 (sysV88)
|
||||||
*/
|
*/
|
||||||
#ifdef sysV88
|
#ifdef sysV88
|
||||||
@ -269,8 +269,8 @@ typedef char * caddr_t;
|
|||||||
# define _PID_T
|
# define _PID_T
|
||||||
# endif /* _PID_T */
|
# endif /* _PID_T */
|
||||||
#endif /* sysV88 */
|
#endif /* sysV88 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Amdahl running UTS (Sys V3)
|
* Amdahl running UTS (Sys V3)
|
||||||
*/
|
*/
|
||||||
#ifdef uts
|
#ifdef uts
|
||||||
@ -279,7 +279,7 @@ typedef char * caddr_t;
|
|||||||
# endif /* _PID_T */
|
# endif /* _PID_T */
|
||||||
#endif /* uts */
|
#endif /* uts */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tektronix XD88/10 running UTekV (Sys V3)
|
* Tektronix XD88/10 running UTekV (Sys V3)
|
||||||
*/
|
*/
|
||||||
#ifdef UTekV
|
#ifdef UTekV
|
||||||
@ -308,7 +308,7 @@ typedef char * caddr_t;
|
|||||||
typedef int pid_t; /* FX-80 */
|
typedef int pid_t; /* FX-80 */
|
||||||
# else
|
# else
|
||||||
typedef short pid_t; /* FX-2800 */
|
typedef short pid_t; /* FX-2800 */
|
||||||
# endif
|
# endif
|
||||||
#endif /* alliant */
|
#endif /* alliant */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -367,7 +367,7 @@ typedef char * caddr_t;
|
|||||||
# endif /* _SPEED_T */
|
# endif /* _SPEED_T */
|
||||||
|
|
||||||
# ifndef _PTR_T
|
# ifndef _PTR_T
|
||||||
# define _PTR_T
|
# define _PTR_T
|
||||||
typedef char * ptr_t;
|
typedef char * ptr_t;
|
||||||
#endif /* _PTR_T */
|
#endif /* _PTR_T */
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ typedef char * caddr_t;
|
|||||||
*** This is our own junk types.
|
*** This is our own junk types.
|
||||||
***/
|
***/
|
||||||
#ifndef _PTR_T
|
#ifndef _PTR_T
|
||||||
# define _PTR_T
|
# define _PTR_T
|
||||||
typedef void * ptr_t;
|
typedef void * ptr_t;
|
||||||
#endif /* _PTR_T */
|
#endif /* _PTR_T */
|
||||||
|
|
||||||
|
@ -77,8 +77,8 @@ out_of_memory (void)
|
|||||||
extern void* sbrk();
|
extern void* sbrk();
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Lots of os routines are busted and try to free invalid pointers.
|
* Lots of os routines are busted and try to free invalid pointers.
|
||||||
* Although our free routine is smart enough and it will pick bad
|
* Although our free routine is smart enough and it will pick bad
|
||||||
* pointers most of the time, in cases where we know we are going to get
|
* pointers most of the time, in cases where we know we are going to get
|
||||||
* a bad pointer, we'd rather leak.
|
* a bad pointer, we'd rather leak.
|
||||||
*/
|
*/
|
||||||
@ -190,7 +190,7 @@ malloc(size_t nbytes)
|
|||||||
/*
|
/*
|
||||||
* SunOS localtime() overwrites the 9th byte on an 8 byte malloc()....
|
* SunOS localtime() overwrites the 9th byte on an 8 byte malloc()....
|
||||||
* so we get one more...
|
* so we get one more...
|
||||||
* From Michael Schroeder: This is not true. It depends on the
|
* From Michael Schroeder: This is not true. It depends on the
|
||||||
* timezone string. In Europe it can overwrite the 13th byte on a
|
* timezone string. In Europe it can overwrite the 13th byte on a
|
||||||
* 12 byte malloc.
|
* 12 byte malloc.
|
||||||
* So we punt and we always allocate an extra byte.
|
* So we punt and we always allocate an extra byte.
|
||||||
@ -379,7 +379,7 @@ calloc(size_t i, size_t j)
|
|||||||
*/
|
*/
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
/* 4 should be plenty, -1 =>'s whole list */
|
/* 4 should be plenty, -1 =>'s whole list */
|
||||||
static int realloc_srchlen = 4;
|
static int realloc_srchlen = 4;
|
||||||
#endif /* lint */
|
#endif /* lint */
|
||||||
|
|
||||||
memalign_t
|
memalign_t
|
||||||
@ -402,7 +402,7 @@ realloc(ptr_t cp, size_t nbytes)
|
|||||||
else
|
else
|
||||||
/*
|
/*
|
||||||
* Already free, doing "compaction".
|
* Already free, doing "compaction".
|
||||||
*
|
*
|
||||||
* Search for the old block of memory on the free list. First, check the
|
* Search for the old block of memory on the free list. First, check the
|
||||||
* most common case (last element free'd), then (this failing) the last
|
* most common case (last element free'd), then (this failing) the last
|
||||||
* ``realloc_srchlen'' items free'd. If all lookups fail, then assume
|
* ``realloc_srchlen'' items free'd. If all lookups fail, then assume
|
||||||
@ -416,7 +416,7 @@ realloc(ptr_t cp, size_t nbytes)
|
|||||||
onb = MEMALIGN(nbytes + MEMALIGN(sizeof(union overhead)) + RSLOP);
|
onb = MEMALIGN(nbytes + MEMALIGN(sizeof(union overhead)) + RSLOP);
|
||||||
|
|
||||||
/* avoid the copy if same size block */
|
/* avoid the copy if same size block */
|
||||||
if (was_alloced && (onb <= (U_int) (1 << (i + 3))) &&
|
if (was_alloced && (onb <= (U_int) (1 << (i + 3))) &&
|
||||||
(onb > (U_int) (1 << (i + 2)))) {
|
(onb > (U_int) (1 << (i + 2)))) {
|
||||||
#ifdef RCHECK
|
#ifdef RCHECK
|
||||||
/* JMR: formerly this wasn't updated ! */
|
/* JMR: formerly this wasn't updated ! */
|
||||||
@ -430,8 +430,8 @@ realloc(ptr_t cp, size_t nbytes)
|
|||||||
if ((res = malloc(nbytes)) == NULL)
|
if ((res = malloc(nbytes)) == NULL)
|
||||||
return ((memalign_t) NULL);
|
return ((memalign_t) NULL);
|
||||||
if (cp != res) { /* common optimization */
|
if (cp != res) { /* common optimization */
|
||||||
/*
|
/*
|
||||||
* christos: this used to copy nbytes! It should copy the
|
* christos: this used to copy nbytes! It should copy the
|
||||||
* smaller of the old and new size
|
* smaller of the old and new size
|
||||||
*/
|
*/
|
||||||
onb = (1 << (i + 3)) - MEMALIGN(sizeof(union overhead)) - RSLOP;
|
onb = (1 << (i + 3)) - MEMALIGN(sizeof(union overhead)) - RSLOP;
|
||||||
@ -636,7 +636,7 @@ showall(Char **v, struct command *c)
|
|||||||
memtop = sbrk(0);
|
memtop = sbrk(0);
|
||||||
#endif /* USE_SBRK */
|
#endif /* USE_SBRK */
|
||||||
xprintf(CGETS(19, 12, "Allocated memory from 0x%lx to 0x%lx (%ld).\n"),
|
xprintf(CGETS(19, 12, "Allocated memory from 0x%lx to 0x%lx (%ld).\n"),
|
||||||
(unsigned long) membot, (unsigned long) memtop,
|
(unsigned long) membot, (unsigned long) memtop,
|
||||||
(unsigned long) (memtop - membot));
|
(unsigned long) (memtop - membot));
|
||||||
#else /* HAVE_MALLINFO */
|
#else /* HAVE_MALLINFO */
|
||||||
struct mallinfo mi;
|
struct mallinfo mi;
|
||||||
|
@ -68,13 +68,13 @@ dobindkey(Char **v, struct command *c)
|
|||||||
map = CcKeyMap;
|
map = CcKeyMap;
|
||||||
ntype = XK_CMD;
|
ntype = XK_CMD;
|
||||||
key = removeb = bindk = 0;
|
key = removeb = bindk = 0;
|
||||||
for (no = 1, par = v[no];
|
for (no = 1, par = v[no];
|
||||||
par != NULL && (*par++ & CHAR) == '-'; no++, par = v[no]) {
|
par != NULL && (*par++ & CHAR) == '-'; no++, par = v[no]) {
|
||||||
if ((p = (*par & CHAR)) == '-') {
|
if ((p = (*par & CHAR)) == '-') {
|
||||||
no++;
|
no++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
switch (p) {
|
switch (p) {
|
||||||
case 'b':
|
case 'b':
|
||||||
bindk = 1;
|
bindk = 1;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
Char STRlogout[] = { 'l', 'o', 'g', 'o', 'u', 't', '\0' };
|
Char STRlogout[] = { 'l', 'o', 'g', 'o', 'u', 't', '\0' };
|
||||||
Char STRautologout[] = { 'a', 'u', 't', 'o', 'l', 'o', 'g', 'o', 'u', 't',
|
Char STRautologout[] = { 'a', 'u', 't', 'o', 'l', 'o', 'g', 'o', 'u', 't',
|
||||||
'\0' };
|
'\0' };
|
||||||
Char STRdefautologout[] = { '6', '0', '\0' };
|
Char STRdefautologout[] = { '6', '0', '\0' };
|
||||||
#ifdef convex
|
#ifdef convex
|
||||||
@ -74,7 +74,7 @@ Char STRnetwork[] = { 'n', 'e', 't', 'w', 'o', 'r', 'k', '\0' };
|
|||||||
Char STRdumb[] = { 'd', 'u', 'm', 'b', '\0' };
|
Char STRdumb[] = { 'd', 'u', 'm', 'b', '\0' };
|
||||||
Char STRHOST[] = { 'H', 'O', 'S', 'T', '\0' };
|
Char STRHOST[] = { 'H', 'O', 'S', 'T', '\0' };
|
||||||
#ifdef REMOTEHOST
|
#ifdef REMOTEHOST
|
||||||
Char STRREMOTEHOST[] = { 'R', 'E', 'M', 'O', 'T', 'E', 'H',
|
Char STRREMOTEHOST[] = { 'R', 'E', 'M', 'O', 'T', 'E', 'H',
|
||||||
'O', 'S', 'T', '\0' };
|
'O', 'S', 'T', '\0' };
|
||||||
#endif /* REMOTEHOST */
|
#endif /* REMOTEHOST */
|
||||||
Char STRHOSTTYPE[] = { 'H', 'O', 'S', 'T', 'T', 'Y', 'P', 'E', '\0' };
|
Char STRHOSTTYPE[] = { 'H', 'O', 'S', 'T', 'T', 'Y', 'P', 'E', '\0' };
|
||||||
@ -113,7 +113,7 @@ Char STRmm[] = { '-', 'm', '\0' };
|
|||||||
Char STRmr[] = { '-', 'r', '\0' };
|
Char STRmr[] = { '-', 'r', '\0' };
|
||||||
Char STRmerge[] = { 'm', 'e', 'r', 'g', 'e', '\0' };
|
Char STRmerge[] = { 'm', 'e', 'r', 'g', 'e', '\0' };
|
||||||
Char STRlock[] = { 'l', 'o', 'c', 'k', '\0' };
|
Char STRlock[] = { 'l', 'o', 'c', 'k', '\0' };
|
||||||
Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r',
|
Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r',
|
||||||
'y', '\0' };
|
'y', '\0' };
|
||||||
|
|
||||||
#ifdef NLS_CATALOGS
|
#ifdef NLS_CATALOGS
|
||||||
@ -254,8 +254,8 @@ Char STRsldtlogout[] = { '/', '.', 'l', 'o', 'g', 'o', 'u', 't', '\0' };
|
|||||||
Char STRjobs[] = { 'j', 'o', 'b', 's', '\0' };
|
Char STRjobs[] = { 'j', 'o', 'b', 's', '\0' };
|
||||||
Char STRdefprompt[] = { '%', '#', ' ', '\0' };
|
Char STRdefprompt[] = { '%', '#', ' ', '\0' };
|
||||||
Char STRmquestion[] = { '%', 'R', (Char)('?' | QUOTE), ' ', '\0' };
|
Char STRmquestion[] = { '%', 'R', (Char)('?' | QUOTE), ' ', '\0' };
|
||||||
Char STRKCORRECT[] = { 'C', 'O', 'R', 'R', 'E', 'C', 'T', '>', '%', 'R',
|
Char STRKCORRECT[] = { 'C', 'O', 'R', 'R', 'E', 'C', 'T', '>', '%', 'R',
|
||||||
' ', '(', 'y', '|', 'n', '|', 'e', '|', 'a', ')',
|
' ', '(', 'y', '|', 'n', '|', 'e', '|', 'a', ')',
|
||||||
(Char)('?' | QUOTE), ' ', '\0' };
|
(Char)('?' | QUOTE), ' ', '\0' };
|
||||||
Char STRunalias[] = { 'u', 'n', 'a', 'l', 'i', 'a', 's', '\0' };
|
Char STRunalias[] = { 'u', 'n', 'a', 'l', 'i', 'a', 's', '\0' };
|
||||||
Char STRalias[] = { 'a', 'l', 'i', 'a', 's', '\0' };
|
Char STRalias[] = { 'a', 'l', 'i', 'a', 's', '\0' };
|
||||||
@ -282,7 +282,7 @@ Char STRsymlinks[] = { 's', 'y', 'm', 'l', 'i', 'n', 'k', 's', '\0' };
|
|||||||
Char STRignore[] = { 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
|
Char STRignore[] = { 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
|
||||||
Char STRchase[] = { 'c', 'h', 'a', 's', 'e', '\0' };
|
Char STRchase[] = { 'c', 'h', 'a', 's', 'e', '\0' };
|
||||||
Char STRexpand[] = { 'e', 'x', 'p', 'a', 'n', 'd', '\0' };
|
Char STRexpand[] = { 'e', 'x', 'p', 'a', 'n', 'd', '\0' };
|
||||||
Char STRecho_style[] = { 'e', 'c', 'h', 'o', '_', 's', 't', 'y', 'l', 'e',
|
Char STRecho_style[] = { 'e', 'c', 'h', 'o', '_', 's', 't', 'y', 'l', 'e',
|
||||||
'\0' };
|
'\0' };
|
||||||
Char STRbsd[] = { 'b', 's', 'd', '\0' };
|
Char STRbsd[] = { 'b', 's', 'd', '\0' };
|
||||||
Char STRsysv[] = { 's', 'y', 's', 'v', '\0' };
|
Char STRsysv[] = { 's', 'y', 's', 'v', '\0' };
|
||||||
@ -313,7 +313,7 @@ Char STRfakecom1[] = { '`', ' ', '.', '.', '.', ' ', '`', '\0' };
|
|||||||
Char STRampm[] = { 'a', 'm', 'p', 'm', '\0' };
|
Char STRampm[] = { 'a', 'm', 'p', 'm', '\0' };
|
||||||
Char STRtime[] = { 't', 'i', 'm', 'e', '\0' };
|
Char STRtime[] = { 't', 'i', 'm', 'e', '\0' };
|
||||||
Char STRnotify[] = { 'n', 'o', 't', 'i', 'f', 'y', '\0' };
|
Char STRnotify[] = { 'n', 'o', 't', 'i', 'f', 'y', '\0' };
|
||||||
Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v',
|
Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v',
|
||||||
'a', 'l', 'u', 'e', '\0' };
|
'a', 'l', 'u', 'e', '\0' };
|
||||||
Char STRLparensp[] = { '(', ' ', '\0' };
|
Char STRLparensp[] = { '(', ' ', '\0' };
|
||||||
Char STRspRparen[] = { ' ', ')', '\0' };
|
Char STRspRparen[] = { ' ', ')', '\0' };
|
||||||
@ -371,7 +371,7 @@ Char STRignoreeof[] = { 'i', 'g', 'n', 'o', 'r', 'e', 'e', 'o', 'f', '\0' };
|
|||||||
Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
|
Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
|
||||||
Char STRnotempty[] = { 'n', 'o', 't', 'e', 'm', 'p', 't', 'y', '\0' };
|
Char STRnotempty[] = { 'n', 'o', 't', 'e', 'm', 'p', 't', 'y', '\0' };
|
||||||
Char STRask[] = { 'a', 's', 'k', '\0' };
|
Char STRask[] = { 'a', 's', 'k', '\0' };
|
||||||
Char STRhelpcommand[] = { 'h', 'e', 'l', 'p', 'c', 'o', 'm', 'm', 'a', 'n',
|
Char STRhelpcommand[] = { 'h', 'e', 'l', 'p', 'c', 'o', 'm', 'm', 'a', 'n',
|
||||||
'd', '\0' };
|
'd', '\0' };
|
||||||
Char STRfignore[] = { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
|
Char STRfignore[] = { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
|
||||||
Char STRrecexact[] = { 'r', 'e', 'c', 'e', 'x', 'a', 'c', 't', '\0' };
|
Char STRrecexact[] = { 'r', 'e', 'c', 'e', 'x', 'a', 'c', 't', '\0' };
|
||||||
@ -406,9 +406,9 @@ Char STRret[] = { '\n', '\0' };
|
|||||||
Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' };
|
Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' };
|
||||||
Char STRnoding[] = { 'n', 'o', 'd', 'i', 'n', 'g', '\0' };
|
Char STRnoding[] = { 'n', 'o', 'd', 'i', 'n', 'g', '\0' };
|
||||||
Char STRpadhour[] = { 'p', 'a', 'd', 'h', 'o', 'u', 'r', '\0' };
|
Char STRpadhour[] = { 'p', 'a', 'd', 'h', 'o', 'u', 'r', '\0' };
|
||||||
Char STRnoambiguous[] = { 'n', 'o', 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u',
|
Char STRnoambiguous[] = { 'n', 'o', 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u',
|
||||||
's', '\0' };
|
's', '\0' };
|
||||||
Char STRvisiblebell[] = { 'v', 'i', 's', 'i', 'b', 'l', 'e', 'b', 'e', 'l',
|
Char STRvisiblebell[] = { 'v', 'i', 's', 'i', 'b', 'l', 'e', 'b', 'e', 'l',
|
||||||
'l', '\0' };
|
'l', '\0' };
|
||||||
Char STRrecognize_only_executables[] = { 'r', 'e', 'c', 'o', 'g', 'n', 'i',
|
Char STRrecognize_only_executables[] = { 'r', 'e', 'c', 'o', 'g', 'n', 'i',
|
||||||
'z', 'e', '_', 'o', 'n', 'l', 'y',
|
'z', 'e', '_', 'o', 'n', 'l', 'y',
|
||||||
|
@ -153,8 +153,8 @@ extern void doucb (Char **, struct command *);
|
|||||||
#endif /* hcx */
|
#endif /* hcx */
|
||||||
|
|
||||||
#ifdef _SEQUENT_
|
#ifdef _SEQUENT_
|
||||||
extern void pr_stat_sub (struct process_stats *,
|
extern void pr_stat_sub (struct process_stats *,
|
||||||
struct process_stats *,
|
struct process_stats *,
|
||||||
struct process_stats *);
|
struct process_stats *);
|
||||||
#endif /* _SEQUENT_ */
|
#endif /* _SEQUENT_ */
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ dolist(Char **v, struct command *c)
|
|||||||
(*dp != (Char) ('/' | QUOTE))) {
|
(*dp != (Char) ('/' | QUOTE))) {
|
||||||
Strbuf_append1(&buf, '/');
|
Strbuf_append1(&buf, '/');
|
||||||
Strbuf_terminate(&buf);
|
Strbuf_terminate(&buf);
|
||||||
} else
|
} else
|
||||||
*dp &= TRIM;
|
*dp &= TRIM;
|
||||||
(void) t_search(&buf, LIST, TW_ZERO, 0, STRNULL, 0);
|
(void) t_search(&buf, LIST, TW_ZERO, 0, STRNULL, 0);
|
||||||
i = k + 1;
|
i = k + 1;
|
||||||
@ -481,7 +481,7 @@ dowhich(Char **v, struct command *c)
|
|||||||
* we glob here.
|
* we glob here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (*++v)
|
while (*++v)
|
||||||
rv &= cmd_expand(*v, NULL);
|
rv &= cmd_expand(*v, NULL);
|
||||||
|
|
||||||
if (!rv)
|
if (!rv)
|
||||||
@ -563,7 +563,7 @@ find_stop_ed(void)
|
|||||||
for (cp = p; *cp && !isspace((unsigned char) *cp); cp++)
|
for (cp = p; *cp && !isspace((unsigned char) *cp); cp++)
|
||||||
continue;
|
continue;
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
|
||||||
if ((cp = strrchr(p, '/')) != NULL) /* and it has a path */
|
if ((cp = strrchr(p, '/')) != NULL) /* and it has a path */
|
||||||
cp = cp + 1; /* then we want only the last part */
|
cp = cp + 1; /* then we want only the last part */
|
||||||
else
|
else
|
||||||
@ -658,7 +658,7 @@ xgetpass(const char *prm)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
if (xread(fd, &c, 1) < 1 || c == '\n')
|
if (xread(fd, &c, 1) < 1 || c == '\n')
|
||||||
break;
|
break;
|
||||||
strbuf_append1(&pass, c);
|
strbuf_append1(&pass, c);
|
||||||
}
|
}
|
||||||
@ -680,7 +680,7 @@ xgetpass(const char *prm)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Ask the user for his login password to continue working
|
* Ask the user for his login password to continue working
|
||||||
* On systems that have a shadow password, this will only
|
* On systems that have a shadow password, this will only
|
||||||
* work for root, but what can we do?
|
* work for root, but what can we do?
|
||||||
*
|
*
|
||||||
* If we fail to get the password, then we log the user out
|
* If we fail to get the password, then we log the user out
|
||||||
@ -889,7 +889,7 @@ cwd_cmd(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Joachim Hoenig 07/16/91 Added beep_cmd, run every time tcsh wishes
|
* Joachim Hoenig 07/16/91 Added beep_cmd, run every time tcsh wishes
|
||||||
* to beep the terminal bell. Useful for playing nice sounds instead.
|
* to beep the terminal bell. Useful for playing nice sounds instead.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -951,11 +951,11 @@ period_cmd(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GrP Greg Parker May 2001
|
* GrP Greg Parker May 2001
|
||||||
* Added job_cmd(), which is run every time a job is started or
|
* Added job_cmd(), which is run every time a job is started or
|
||||||
* foregrounded. The command is passed a single argument, the string
|
* foregrounded. The command is passed a single argument, the string
|
||||||
* used to start the job originally. With precmd, useful for setting
|
* used to start the job originally. With precmd, useful for setting
|
||||||
* xterm titles.
|
* xterm titles.
|
||||||
* Cloned from cwd_cmd().
|
* Cloned from cwd_cmd().
|
||||||
*/
|
*/
|
||||||
@ -1467,7 +1467,7 @@ gethomedir(const Char *us)
|
|||||||
char **res, **res1, *cp;
|
char **res, **res1, *cp;
|
||||||
Char *rp;
|
Char *rp;
|
||||||
#endif /* HESIOD */
|
#endif /* HESIOD */
|
||||||
|
|
||||||
pp = xgetpwnam(short2str(us));
|
pp = xgetpwnam(short2str(us));
|
||||||
#ifdef YPBUGS
|
#ifdef YPBUGS
|
||||||
fix_yp_bugs();
|
fix_yp_bugs();
|
||||||
@ -1719,7 +1719,7 @@ fixio(int fd, int e)
|
|||||||
FNDELAY|_FNDELAY|FNDLEAY); /* whew! */
|
FNDELAY|_FNDELAY|FNDLEAY); /* whew! */
|
||||||
if (fcntl(fd, F_SETFL, e) == -1)
|
if (fcntl(fd, F_SETFL, e) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
e = 0;
|
e = 0;
|
||||||
# endif /* F_SETFL */
|
# endif /* F_SETFL */
|
||||||
|
|
||||||
@ -1763,7 +1763,7 @@ collate(const Char *a, const Char *b)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* We should be checking for errno != 0, but some systems
|
* We should be checking for errno != 0, but some systems
|
||||||
* forget to reset errno to 0. So we only check for the
|
* forget to reset errno to 0. So we only check for the
|
||||||
* only documented valid errno value for strcoll [EINVAL]
|
* only documented valid errno value for strcoll [EINVAL]
|
||||||
*/
|
*/
|
||||||
if (errno == EINVAL) {
|
if (errno == EINVAL) {
|
||||||
@ -1858,7 +1858,7 @@ hashbang(int fd, Char ***vp)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (!ws) /* Start a new word? */
|
if (!ws) /* Start a new word? */
|
||||||
ws = p;
|
ws = p;
|
||||||
p++;
|
p++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2102,7 +2102,7 @@ dotermname(Char **v, struct command *c)
|
|||||||
/* try to find which entry we should be looking for */
|
/* try to find which entry we should be looking for */
|
||||||
termtype = (v[1] == NULL ? getenv("TERM") : short2str(v[1]));
|
termtype = (v[1] == NULL ? getenv("TERM") : short2str(v[1]));
|
||||||
if (termtype == NULL) {
|
if (termtype == NULL) {
|
||||||
/* no luck - the user didn't provide one and none is
|
/* no luck - the user didn't provide one and none is
|
||||||
* specified in the environment
|
* specified in the environment
|
||||||
*/
|
*/
|
||||||
setcopy(STRstatus, STR1, VAR_READWRITE);
|
setcopy(STRstatus, STR1, VAR_READWRITE);
|
||||||
@ -2110,7 +2110,7 @@ dotermname(Char **v, struct command *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we use the termcap function - if we are using terminfo we
|
* we use the termcap function - if we are using terminfo we
|
||||||
* will end up with it's compatibility function
|
* will end up with it's compatibility function
|
||||||
* terminfo/termcap will be initialized with the new
|
* terminfo/termcap will be initialized with the new
|
||||||
* type but we don't care because tcsh has cached all the things
|
* type but we don't care because tcsh has cached all the things
|
||||||
|
@ -64,7 +64,7 @@ static Char STRMPATH[] = {'M', 'P', 'A', 'T', 'H', '\0'};
|
|||||||
static Char STREPATH[] = {'E', 'P', 'A', 'T', 'H', '\0'};
|
static Char STREPATH[] = {'E', 'P', 'A', 'T', 'H', '\0'};
|
||||||
# endif
|
# endif
|
||||||
#endif /* MACH */
|
#endif /* MACH */
|
||||||
static Char *syspaths[] = {STRKPATH, STRCPATH, STRLPATH, STRMPATH,
|
static Char *syspaths[] = {STRKPATH, STRCPATH, STRLPATH, STRMPATH,
|
||||||
|
|
||||||
#if EPATH
|
#if EPATH
|
||||||
STREPATH,
|
STREPATH,
|
||||||
@ -302,11 +302,11 @@ dogetspath(Char **v, struct command *c)
|
|||||||
xprintf("%s ", xc);
|
xprintf("%s ", xc);
|
||||||
else
|
else
|
||||||
xprintf("*cpu %d* ", (int) (p[i] & SPATH_MASK));
|
xprintf("*cpu %d* ", (int) (p[i] & SPATH_MASK));
|
||||||
/*
|
/*
|
||||||
* BUG in the aix code... needs that cause if
|
* BUG in the aix code... needs that cause if
|
||||||
* sfxcode fails once it fails for ever
|
* sfxcode fails once it fails for ever
|
||||||
*/
|
*/
|
||||||
endsf();
|
endsf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -552,7 +552,7 @@ catch_sigsys(void)
|
|||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
dowarp(Char **v, struct command *c)
|
dowarp(Char **v, struct command *c)
|
||||||
{
|
{
|
||||||
int warp, oldwarp;
|
int warp, oldwarp;
|
||||||
struct warpent *we;
|
struct warpent *we;
|
||||||
@ -619,7 +619,7 @@ setuniverse_cleanup(void *xbuf)
|
|||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
douniverse(Char **v, struct command *c)
|
douniverse(Char **v, struct command *c)
|
||||||
{
|
{
|
||||||
Char *cp = v[1];
|
Char *cp = v[1];
|
||||||
Char *cp2; /* dunno how many elements v comes in with */
|
Char *cp2; /* dunno how many elements v comes in with */
|
||||||
@ -713,7 +713,7 @@ bs2cmdlist(char *str)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
str_beg = str;
|
str_beg = str;
|
||||||
|
|
||||||
for (; *str != '\0'; ++str)
|
for (; *str != '\0'; ++str)
|
||||||
{
|
{
|
||||||
if (string == outside && *str == ';') /* End of command */
|
if (string == outside && *str == ';') /* End of command */
|
||||||
@ -973,7 +973,7 @@ void *xmemset(void *loc, int value, size_t len)
|
|||||||
#ifndef HAVE_MEMMOVE
|
#ifndef HAVE_MEMMOVE
|
||||||
/* memmove():
|
/* memmove():
|
||||||
* This is the ANSI form of bcopy() with the arguments backwards...
|
* This is the ANSI form of bcopy() with the arguments backwards...
|
||||||
* Unlike memcpy(), it handles overlaps between source and
|
* Unlike memcpy(), it handles overlaps between source and
|
||||||
* destination memory
|
* destination memory
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
@ -986,13 +986,13 @@ xmemmove(void *vdst, const void *vsrc, size_t len)
|
|||||||
return vdst;
|
return vdst;
|
||||||
|
|
||||||
if (src > dst) {
|
if (src > dst) {
|
||||||
while (len--)
|
while (len--)
|
||||||
*dst++ = *src++;
|
*dst++ = *src++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
src += len;
|
src += len;
|
||||||
dst += len;
|
dst += len;
|
||||||
while (len--)
|
while (len--)
|
||||||
*--dst = *--src;
|
*--dst = *--src;
|
||||||
}
|
}
|
||||||
return vdst;
|
return vdst;
|
||||||
@ -1062,7 +1062,7 @@ fix_strcoll_bug(void)
|
|||||||
* We have to call this routine every time the locale changes...
|
* We have to call this routine every time the locale changes...
|
||||||
*
|
*
|
||||||
* Of course it also tries to free the constant locale "C" it initially
|
* Of course it also tries to free the constant locale "C" it initially
|
||||||
* had allocated, with the sequence
|
* had allocated, with the sequence
|
||||||
* > setenv LANG "fr"
|
* > setenv LANG "fr"
|
||||||
* > ls^D
|
* > ls^D
|
||||||
* > unsetenv LANG
|
* > unsetenv LANG
|
||||||
@ -1110,7 +1110,7 @@ osinit(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _SX
|
#ifdef _SX
|
||||||
/*
|
/*
|
||||||
* kill(SIGCONT) problems, don't know what this syscall does
|
* kill(SIGCONT) problems, don't know what this syscall does
|
||||||
* [schott@rzg.mpg.de]
|
* [schott@rzg.mpg.de]
|
||||||
*/
|
*/
|
||||||
@ -1135,7 +1135,7 @@ xstrerror(int i)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_STRERROR */
|
#endif /* !HAVE_STRERROR */
|
||||||
|
|
||||||
#ifndef HAVE_GETHOSTNAME
|
#ifndef HAVE_GETHOSTNAME
|
||||||
# if !defined(_MINIX) && !defined(__EMX__) && !defined(WINNT_NATIVE)
|
# if !defined(_MINIX) && !defined(__EMX__) && !defined(WINNT_NATIVE)
|
||||||
# include <sys/utsname.h>
|
# include <sys/utsname.h>
|
||||||
@ -1182,7 +1182,7 @@ xgethostname(char *name, int namlen)
|
|||||||
# undef HZ /* redefined in <minix/const.h> */
|
# undef HZ /* redefined in <minix/const.h> */
|
||||||
# include <lib.h>
|
# include <lib.h>
|
||||||
# endif /* _MINIX && NICE */
|
# endif /* _MINIX && NICE */
|
||||||
int
|
int
|
||||||
xnice(int incr)
|
xnice(int incr)
|
||||||
{
|
{
|
||||||
#if defined(_MINIX) && defined(NICE)
|
#if defined(_MINIX) && defined(NICE)
|
||||||
@ -1250,7 +1250,7 @@ xgetcwd(char *pathname, size_t pathlen)
|
|||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
if ((dir = readdir(dirp)) == NULL) {
|
if ((dir = readdir(dirp)) == NULL) {
|
||||||
(void) xsnprintf(pathname, pathlen,
|
(void) xsnprintf(pathname, pathlen,
|
||||||
CGETS(23, 21, "getcwd: Read error in \"..\" (%s)"),
|
CGETS(23, 21, "getcwd: Read error in \"..\" (%s)"),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -1307,7 +1307,7 @@ xgetcwd(char *pathname, size_t pathlen)
|
|||||||
|
|
||||||
/* find the inode of root */
|
/* find the inode of root */
|
||||||
if (stat("/", &st_root) == -1) {
|
if (stat("/", &st_root) == -1) {
|
||||||
(void) xsnprintf(pathname, pathlen, CGETS(23, 23,
|
(void) xsnprintf(pathname, pathlen, CGETS(23, 23,
|
||||||
"getcwd: Cannot stat \"/\" (%s)"),
|
"getcwd: Cannot stat \"/\" (%s)"),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1365,9 +1365,9 @@ xgetcwd(char *pathname, size_t pathlen)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
* Parent has a different device. This is a mount point so we
|
* Parent has a different device. This is a mount point so we
|
||||||
* need to stat every member
|
* need to stat every member
|
||||||
*/
|
*/
|
||||||
for (d = readdir(dp); d != NULL; d = readdir(dp)) {
|
for (d = readdir(dp); d != NULL; d = readdir(dp)) {
|
||||||
if (ISDOT(d->d_name) || ISDOTDOT(d->d_name))
|
if (ISDOT(d->d_name) || ISDOTDOT(d->d_name))
|
||||||
@ -1387,7 +1387,7 @@ xgetcwd(char *pathname, size_t pathlen)
|
|||||||
}
|
}
|
||||||
/* check if we found it yet */
|
/* check if we found it yet */
|
||||||
if (st_next.st_ino == st_cur.st_ino &&
|
if (st_next.st_ino == st_cur.st_ino &&
|
||||||
DEV_DEV_COMPARE(st_next.st_dev, st_cur.st_dev))
|
DEV_DEV_COMPARE(st_next.st_dev, st_cur.st_dev))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1461,7 +1461,7 @@ llib(Char *s)
|
|||||||
char *t;
|
char *t;
|
||||||
|
|
||||||
loader_$inlib(t = short2str(s), len, &st);
|
loader_$inlib(t = short2str(s), len, &st);
|
||||||
if (st.all != status_$ok)
|
if (st.all != status_$ok)
|
||||||
stderror(ERR_SYSTEM, t, apperr(&st));
|
stderror(ERR_SYSTEM, t, apperr(&st));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1476,7 +1476,7 @@ doinlib(Char **v, struct command *c)
|
|||||||
globbed = v;
|
globbed = v;
|
||||||
cleanup_push(globbed, blk_cleanup);
|
cleanup_push(globbed, blk_cleanup);
|
||||||
|
|
||||||
while (v && *v)
|
while (v && *v)
|
||||||
llib(*v++);
|
llib(*v++);
|
||||||
cleanup_until(globbed);
|
cleanup_until(globbed);
|
||||||
}
|
}
|
||||||
@ -1488,7 +1488,7 @@ getv(Char *v)
|
|||||||
return(1);
|
return(1);
|
||||||
else if (eq(v, STRsys53))
|
else if (eq(v, STRsys53))
|
||||||
return(0);
|
return(0);
|
||||||
else
|
else
|
||||||
stderror(ERR_NAME | ERR_SYSTEM, short2str(v),
|
stderror(ERR_NAME | ERR_SYSTEM, short2str(v),
|
||||||
CGETS(23, 28, "Invalid system type"));
|
CGETS(23, 28, "Invalid system type"));
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
@ -1542,11 +1542,11 @@ dorootnode(Char **v, struct command *c)
|
|||||||
namelen = strlen(name);
|
namelen = strlen(name);
|
||||||
|
|
||||||
name_$resolve(name, &namelen, &uid, &st);
|
name_$resolve(name, &namelen, &uid, &st);
|
||||||
if (st.all != status_$ok)
|
if (st.all != status_$ok)
|
||||||
stderror(ERR_SYSTEM, name, apperr(&st));
|
stderror(ERR_SYSTEM, name, apperr(&st));
|
||||||
namelen = 0;
|
namelen = 0;
|
||||||
name_$set_diru(&uid, "", &namelen, &dirtype, &st);
|
name_$set_diru(&uid, "", &namelen, &dirtype, &st);
|
||||||
if (st.all != status_$ok)
|
if (st.all != status_$ok)
|
||||||
stderror(ERR_SYSTEM, name, apperr(&st));
|
stderror(ERR_SYSTEM, name, apperr(&st));
|
||||||
dohash(NULL, NULL);
|
dohash(NULL, NULL);
|
||||||
}
|
}
|
||||||
@ -1574,7 +1574,7 @@ isapad(void)
|
|||||||
res = res ? 1 : 0;
|
res = res ? 1 : 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (st.all != status_$ok)
|
if (st.all != status_$ok)
|
||||||
stderror(ERR_SYSTEM, "stream_$isavt", apperr(&st));
|
stderror(ERR_SYSTEM, "stream_$isavt", apperr(&st));
|
||||||
}
|
}
|
||||||
return(res);
|
return(res);
|
||||||
|
@ -32,9 +32,9 @@
|
|||||||
#ifndef _h_tc_os
|
#ifndef _h_tc_os
|
||||||
#define _h_tc_os
|
#define _h_tc_os
|
||||||
|
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
/*
|
/*
|
||||||
* for SVR4 and linux we used to fork pipelines backwards.
|
* for SVR4 and linux we used to fork pipelines backwards.
|
||||||
* This should not be needed any more.
|
* This should not be needed any more.
|
||||||
* more info in sh.sem.c
|
* more info in sh.sem.c
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _VMS_POSIX
|
#ifdef _VMS_POSIX
|
||||||
# ifndef NOFILE
|
# ifndef NOFILE
|
||||||
# define NOFILE 64
|
# define NOFILE 64
|
||||||
# endif /* NOFILE */
|
# endif /* NOFILE */
|
||||||
# define nice(a) setprio((getpid()),a)
|
# define nice(a) setprio((getpid()),a)
|
||||||
@ -79,7 +79,7 @@
|
|||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# ifdef notdef
|
# ifdef notdef
|
||||||
/* Don't include it, because it defines things we don't really have */
|
/* Don't include it, because it defines things we don't really have */
|
||||||
# include <sys/resource.h>
|
# include <sys/resource.h>
|
||||||
# endif /* notdef */
|
# endif /* notdef */
|
||||||
# ifdef POSIX
|
# ifdef POSIX
|
||||||
# include <sys/tty.h>
|
# include <sys/tty.h>
|
||||||
@ -156,7 +156,7 @@ struct ucred {
|
|||||||
#endif /* ISC202 */
|
#endif /* ISC202 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX: This will be changed soon to
|
* XXX: This will be changed soon to
|
||||||
* #if (SYSVREL > 0) && defined(TIOCGWINSZ)
|
* #if (SYSVREL > 0) && defined(TIOCGWINSZ)
|
||||||
* If that breaks on your machine, let me know.
|
* If that breaks on your machine, let me know.
|
||||||
*
|
*
|
||||||
@ -181,7 +181,7 @@ struct ucred {
|
|||||||
#endif /* IRIS4D */
|
#endif /* IRIS4D */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For some versions of system V software, specially ones that use the
|
* For some versions of system V software, specially ones that use the
|
||||||
* Wollongong Software TCP/IP, the FIOCLEX, FIONCLEX, FIONBIO calls
|
* Wollongong Software TCP/IP, the FIOCLEX, FIONCLEX, FIONBIO calls
|
||||||
* might not work correctly for file descriptors [they work only for
|
* might not work correctly for file descriptors [they work only for
|
||||||
* sockets]. So we try to use first the fcntl() and we only use the
|
* sockets]. So we try to use first the fcntl() and we only use the
|
||||||
@ -311,7 +311,7 @@ struct ucred {
|
|||||||
#ifndef S_ISUID
|
#ifndef S_ISUID
|
||||||
# define S_ISUID 0004000 /* setuid */
|
# define S_ISUID 0004000 /* setuid */
|
||||||
#endif /* S_ISUID */
|
#endif /* S_ISUID */
|
||||||
#ifndef S_ISGID
|
#ifndef S_ISGID
|
||||||
# define S_ISGID 0002000 /* setgid */
|
# define S_ISGID 0002000 /* setgid */
|
||||||
#endif /* S_ISGID */
|
#endif /* S_ISGID */
|
||||||
#ifndef S_ISVTX
|
#ifndef S_ISVTX
|
||||||
@ -406,7 +406,7 @@ struct ucred {
|
|||||||
# define NEEDtcgetpgrp
|
# define NEEDtcgetpgrp
|
||||||
#endif /* BSDJOBS && !(POSIX && POSIXJOBS) */
|
#endif /* BSDJOBS && !(POSIX && POSIXJOBS) */
|
||||||
|
|
||||||
#ifdef RENO
|
#ifdef RENO
|
||||||
/*
|
/*
|
||||||
* RENO has this broken. It is fixed on 4.4BSD
|
* RENO has this broken. It is fixed on 4.4BSD
|
||||||
*/
|
*/
|
||||||
@ -540,11 +540,11 @@ extern char *getvwd();
|
|||||||
# endif /* (SUNOS4 && ! __GNUC__) || _IBMR2 || _IBMESA */
|
# endif /* (SUNOS4 && ! __GNUC__) || _IBMR2 || _IBMESA */
|
||||||
|
|
||||||
# ifdef SCO
|
# ifdef SCO
|
||||||
extern char *ttyname();
|
extern char *ttyname();
|
||||||
# endif /* SCO */
|
# endif /* SCO */
|
||||||
|
|
||||||
# ifdef __clipper__
|
# ifdef __clipper__
|
||||||
extern char *ttyname();
|
extern char *ttyname();
|
||||||
# endif /* __clipper__ */
|
# endif /* __clipper__ */
|
||||||
|
|
||||||
#endif /* !POSIX || SUNOS4 || UTekV || sysV88 */
|
#endif /* !POSIX || SUNOS4 || UTekV || sysV88 */
|
||||||
@ -565,7 +565,7 @@ extern int getpeername (int, struct sockaddr *, int *);
|
|||||||
# endif /* REMOTEHOST */
|
# endif /* REMOTEHOST */
|
||||||
#endif /* SUNOS4 && __GNUC__ == 2 */
|
#endif /* SUNOS4 && __GNUC__ == 2 */
|
||||||
|
|
||||||
#if (defined(BSD) && !defined(BSD4_4)) || defined(SUNOS4)
|
#if (defined(BSD) && !defined(BSD4_4)) || defined(SUNOS4)
|
||||||
# if defined(__alpha) && defined(__osf__) && DECOSF1 < 200
|
# if defined(__alpha) && defined(__osf__) && DECOSF1 < 200
|
||||||
extern void bcopy (const void *, void *, size_t);
|
extern void bcopy (const void *, void *, size_t);
|
||||||
# define memmove(a, b, c) (bcopy((char *) (b), (char *) (a), (int) (c)), a)
|
# define memmove(a, b, c) (bcopy((char *) (b), (char *) (a), (int) (c)), a)
|
||||||
|
@ -457,7 +457,7 @@ xasprintf(const char *fmt, ...)
|
|||||||
#ifndef FILE
|
#ifndef FILE
|
||||||
#define FILE int
|
#define FILE int
|
||||||
#endif
|
#endif
|
||||||
int
|
int
|
||||||
fprintf(FILE *fp, const char* fmt, ...)
|
fprintf(FILE *fp, const char* fmt, ...)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
@ -468,7 +468,7 @@ fprintf(FILE *fp, const char* fmt, ...)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
vfprintf(FILE *fp, const char *fmt, va_list va)
|
vfprintf(FILE *fp, const char *fmt, va_list va)
|
||||||
{
|
{
|
||||||
return doprnt(xputchar, fmt, va);
|
return doprnt(xputchar, fmt, va);
|
||||||
|
@ -127,7 +127,7 @@ printprompt(int promptno, const char *str)
|
|||||||
cp = ocp;
|
cp = ocp;
|
||||||
str = ostr;
|
str = ostr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cp = varval(STRprompt);
|
cp = varval(STRprompt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ tprintf(int what, const Char *fmt, const char *str, time_t tim, ptr_t info)
|
|||||||
} /* else do a 24 hour clock */
|
} /* else do a 24 hour clock */
|
||||||
|
|
||||||
/* "DING!" stuff by Hans also */
|
/* "DING!" stuff by Hans also */
|
||||||
if (t->tm_min || print_prompt_did_ding ||
|
if (t->tm_min || print_prompt_did_ding ||
|
||||||
what != FMT_PROMPT || adrof(STRnoding)) {
|
what != FMT_PROMPT || adrof(STRnoding)) {
|
||||||
if (t->tm_min)
|
if (t->tm_min)
|
||||||
print_prompt_did_ding = 0;
|
print_prompt_did_ding = 0;
|
||||||
@ -306,7 +306,7 @@ tprintf(int what, const Char *fmt, const char *str, time_t tim, ptr_t info)
|
|||||||
#ifndef HAVENOUTMP
|
#ifndef HAVENOUTMP
|
||||||
if (what == FMT_WHO)
|
if (what == FMT_WHO)
|
||||||
cz = who_info(info, 'M');
|
cz = who_info(info, 'M');
|
||||||
else
|
else
|
||||||
#endif /* HAVENOUTMP */
|
#endif /* HAVENOUTMP */
|
||||||
cz = getenv("HOST");
|
cz = getenv("HOST");
|
||||||
/*
|
/*
|
||||||
@ -462,7 +462,7 @@ tprintf(int what, const Char *fmt, const char *str, time_t tim, ptr_t info)
|
|||||||
tprintf_append_mbs(&buf, cz, attributes);
|
tprintf_append_mbs(&buf, cz, attributes);
|
||||||
xfree(cz);
|
xfree(cz);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* HAVENOUTMP */
|
#endif /* HAVENOUTMP */
|
||||||
{
|
{
|
||||||
if ((z = varval(STRuser)) != STRNULL)
|
if ((z = varval(STRuser)) != STRNULL)
|
||||||
@ -482,7 +482,7 @@ tprintf(int what, const Char *fmt, const char *str, time_t tim, ptr_t info)
|
|||||||
tprintf_append_mbs(&buf, cz, attributes);
|
tprintf_append_mbs(&buf, cz, attributes);
|
||||||
xfree(cz);
|
xfree(cz);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* HAVENOUTMP */
|
#endif /* HAVENOUTMP */
|
||||||
{
|
{
|
||||||
if ((z = varval(STRtty)) != STRNULL)
|
if ((z = varval(STRtty)) != STRNULL)
|
||||||
|
@ -276,7 +276,7 @@ s_strncpy(Char *dst, const Char *src, size_t n)
|
|||||||
return(dst);
|
return(dst);
|
||||||
|
|
||||||
sdst = dst;
|
sdst = dst;
|
||||||
do
|
do
|
||||||
if ((*dst++ = *src++) == '\0') {
|
if ((*dst++ = *src++) == '\0') {
|
||||||
while (--n != 0)
|
while (--n != 0)
|
||||||
*dst++ = '\0';
|
*dst++ = '\0';
|
||||||
@ -299,7 +299,7 @@ s_strncat(Char *dst, const Char *src, size_t n)
|
|||||||
{
|
{
|
||||||
Char *sdst;
|
Char *sdst;
|
||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return (dst);
|
return (dst);
|
||||||
|
|
||||||
sdst = dst;
|
sdst = dst;
|
||||||
@ -307,7 +307,7 @@ s_strncat(Char *dst, const Char *src, size_t n)
|
|||||||
while (*dst)
|
while (*dst)
|
||||||
dst++;
|
dst++;
|
||||||
|
|
||||||
do
|
do
|
||||||
if ((*dst++ = *src++) == '\0')
|
if ((*dst++ = *src++) == '\0')
|
||||||
return(sdst);
|
return(sdst);
|
||||||
while (--n != 0)
|
while (--n != 0)
|
||||||
@ -380,7 +380,7 @@ s_strncmp(const Char *str1, const Char *str2, size_t n)
|
|||||||
do {
|
do {
|
||||||
if (*str1 != *str2) {
|
if (*str1 != *str2) {
|
||||||
/*
|
/*
|
||||||
* The following case analysis is necessary so that characters
|
* The following case analysis is necessary so that characters
|
||||||
* which look negative collate low against normal characters
|
* which look negative collate low against normal characters
|
||||||
* but high against the end-of-string NUL.
|
* but high against the end-of-string NUL.
|
||||||
*/
|
*/
|
||||||
|
@ -47,57 +47,57 @@ fix_version(void)
|
|||||||
# define SSSTR "8b"
|
# define SSSTR "8b"
|
||||||
#else
|
#else
|
||||||
# define SSSTR "7b"
|
# define SSSTR "7b"
|
||||||
#endif
|
#endif
|
||||||
#ifdef NLS
|
#ifdef NLS
|
||||||
# define NLSSTR ",nls"
|
# define NLSSTR ",nls"
|
||||||
#else
|
#else
|
||||||
# define NLSSTR ""
|
# define NLSSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef LOGINFIRST
|
#ifdef LOGINFIRST
|
||||||
# define LFSTR ",lf"
|
# define LFSTR ",lf"
|
||||||
#else
|
#else
|
||||||
# define LFSTR ""
|
# define LFSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef DOTLAST
|
#ifdef DOTLAST
|
||||||
# define DLSTR ",dl"
|
# define DLSTR ",dl"
|
||||||
#else
|
#else
|
||||||
# define DLSTR ""
|
# define DLSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef VIDEFAULT
|
#ifdef VIDEFAULT
|
||||||
# define VISTR ",vi"
|
# define VISTR ",vi"
|
||||||
#else
|
#else
|
||||||
# define VISTR ""
|
# define VISTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef TESLA
|
#ifdef TESLA
|
||||||
# define DTRSTR ",dtr"
|
# define DTRSTR ",dtr"
|
||||||
#else
|
#else
|
||||||
# define DTRSTR ""
|
# define DTRSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef KAI
|
#ifdef KAI
|
||||||
# define BYESTR ",bye"
|
# define BYESTR ",bye"
|
||||||
#else
|
#else
|
||||||
# define BYESTR ""
|
# define BYESTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef AUTOLOGOUT
|
#ifdef AUTOLOGOUT
|
||||||
# define ALSTR ",al"
|
# define ALSTR ",al"
|
||||||
#else
|
#else
|
||||||
# define ALSTR ""
|
# define ALSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef KANJI
|
#ifdef KANJI
|
||||||
# define KANSTR ",kan"
|
# define KANSTR ",kan"
|
||||||
#else
|
#else
|
||||||
# define KANSTR ""
|
# define KANSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef SYSMALLOC
|
#ifdef SYSMALLOC
|
||||||
# define SMSTR ",sm"
|
# define SMSTR ",sm"
|
||||||
#else
|
#else
|
||||||
# define SMSTR ""
|
# define SMSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef HASHBANG
|
#ifdef HASHBANG
|
||||||
# define HBSTR ",hb"
|
# define HBSTR ",hb"
|
||||||
#else
|
#else
|
||||||
# define HBSTR ""
|
# define HBSTR ""
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEWGRP
|
#ifdef NEWGRP
|
||||||
# define NGSTR ",ng"
|
# define NGSTR ",ng"
|
||||||
#else
|
#else
|
||||||
|
@ -210,7 +210,7 @@ watch_login(int force)
|
|||||||
#if defined(HAVE_STRUCT_UTMP_UT_HOST) && defined(_SEQUENT_)
|
#if defined(HAVE_STRUCT_UTMP_UT_HOST) && defined(_SEQUENT_)
|
||||||
char *host, *ut_find_host();
|
char *host, *ut_find_host();
|
||||||
#endif
|
#endif
|
||||||
#ifdef WINNT_NATIVE
|
#ifdef WINNT_NATIVE
|
||||||
USE(utmp);
|
USE(utmp);
|
||||||
USE(utmpfd);
|
USE(utmpfd);
|
||||||
USE(sta);
|
USE(sta);
|
||||||
@ -233,7 +233,7 @@ watch_login(int force)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
interval = 0;
|
interval = 0;
|
||||||
|
|
||||||
(void) time(&t);
|
(void) time(&t);
|
||||||
if (t - watch_period < interval) {
|
if (t - watch_period < interval) {
|
||||||
cleanup_until(&pintr_disabled);
|
cleanup_until(&pintr_disabled);
|
||||||
@ -326,7 +326,7 @@ watch_login(int force)
|
|||||||
wp->who_status = OFFLINE;
|
wp->who_status = OFFLINE;
|
||||||
}
|
}
|
||||||
else if (strncmp(utmp.ut_name, wp->who_name, UTNAMLEN) == 0) {
|
else if (strncmp(utmp.ut_name, wp->who_name, UTNAMLEN) == 0) {
|
||||||
/* someone is logged in */
|
/* someone is logged in */
|
||||||
wp->who_time = utmp.ut_time;
|
wp->who_time = utmp.ut_time;
|
||||||
wp->who_status = ONLINE | ANNOUNCE; /* same guy */
|
wp->who_status = ONLINE | ANNOUNCE; /* same guy */
|
||||||
}
|
}
|
||||||
@ -631,7 +631,7 @@ utmphost(void)
|
|||||||
char *host = NULL;
|
char *host = NULL;
|
||||||
|
|
||||||
watch_login(1);
|
watch_login(1);
|
||||||
|
|
||||||
for (wp = whohead.who_next; wp->who_next != NULL; wp = wp->who_next) {
|
for (wp = whohead.who_next; wp->who_next != NULL; wp = wp->who_next) {
|
||||||
if (strcmp(tty, wp->who_tty) == 0)
|
if (strcmp(tty, wp->who_tty) == 0)
|
||||||
host = wp->who_host;
|
host = wp->who_host;
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
.\" used here if you can. In particular, please don't use nroff commands
|
.\" used here if you can. In particular, please don't use nroff commands
|
||||||
.\" which aren't already used herein.
|
.\" which aren't already used herein.
|
||||||
.\"
|
.\"
|
||||||
.TH TCSH 1 "11 Nov 2020" "Astron 6.22.03"
|
.TH TCSH 1 "26 Apr 2021" "Astron 6.22.04"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
tcsh \- C shell with file name completion and command line editing
|
tcsh \- C shell with file name completion and command line editing
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -5355,7 +5355,7 @@ pipe(2), setrlimit(2), sigvec(2), stat(2), umask(2), vfork(2), wait(2),
|
|||||||
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
|
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
|
||||||
termio(7), Introduction to the C Shell
|
termio(7), Introduction to the C Shell
|
||||||
.SH VERSION
|
.SH VERSION
|
||||||
This manual documents tcsh 6.22.03 (Astron) 2020-11-18.
|
This manual documents tcsh 6.22.04 (Astron) 2021-04-26.
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP 2
|
.TP 2
|
||||||
|
@ -146,7 +146,7 @@ enum ansi {
|
|||||||
ANSI_BG_DEFAULT = 49, /* bg default (black) */
|
ANSI_BG_DEFAULT = 49, /* bg default (black) */
|
||||||
};
|
};
|
||||||
#define TCSH_BOLD 0x80
|
#define TCSH_BOLD 0x80
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Str extension; /* file extension */
|
Str extension; /* file extension */
|
||||||
Str color; /* color string */
|
Str color; /* color string */
|
||||||
@ -252,11 +252,13 @@ static void
|
|||||||
makecolor(char **c, int fg, int bg, Str *v)
|
makecolor(char **c, int fg, int bg, Str *v)
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
if (fg & 0x80)
|
if (fg & 0x80) {
|
||||||
l = xsnprintf(*c, 12, "%.2d;%.2d;%.2d;%.2d", ANSI_BOLD_ON,
|
l = xsnprintf(*c, 12, "%.2d;%.2d;%.2d;%.2d", ANSI_BOLD_ON,
|
||||||
fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD, ANSI_BOLD_OFF);
|
fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD, ANSI_BOLD_OFF);
|
||||||
|
} else {
|
||||||
l = xsnprintf(*c, 6, "%.2d;%.2d",
|
l = xsnprintf(*c, 6, "%.2d;%.2d",
|
||||||
fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD);
|
fg & ~TCSH_BOLD, (10 + bg) & ~TCSH_BOLD);
|
||||||
|
}
|
||||||
|
|
||||||
v->s = *c;
|
v->s = *c;
|
||||||
v->len = l;
|
v->len = l;
|
||||||
|
@ -132,7 +132,7 @@ tw_prlist(struct varent *p)
|
|||||||
|
|
||||||
|
|
||||||
/* tw_pr():
|
/* tw_pr():
|
||||||
* Pretty print a completion, adding single quotes around
|
* Pretty print a completion, adding single quotes around
|
||||||
* a completion argument and collapsing multiple spaces to one.
|
* a completion argument and collapsing multiple spaces to one.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
@ -158,7 +158,7 @@ tw_pr(Char **cmp)
|
|||||||
|
|
||||||
|
|
||||||
/* tw_find():
|
/* tw_find():
|
||||||
* Find the first matching completion.
|
* Find the first matching completion.
|
||||||
* For commands we only look at names that start with -
|
* For commands we only look at names that start with -
|
||||||
*/
|
*/
|
||||||
static Char **
|
static Char **
|
||||||
@ -199,7 +199,7 @@ tw_pos(Char *ran, int wno)
|
|||||||
|
|
||||||
if (*p == '\0') /* range == <number> */
|
if (*p == '\0') /* range == <number> */
|
||||||
return wno == getn(ran);
|
return wno == getn(ran);
|
||||||
|
|
||||||
if (ran == p) /* range = - <number> */
|
if (ran == p) /* range = - <number> */
|
||||||
return wno <= getn(&ran[1]);
|
return wno <= getn(&ran[1]);
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
@ -221,7 +221,7 @@ tw_tok(Char *str)
|
|||||||
|
|
||||||
if (str != NULL)
|
if (str != NULL)
|
||||||
bf = str;
|
bf = str;
|
||||||
|
|
||||||
/* skip leading spaces */
|
/* skip leading spaces */
|
||||||
for (; *bf && Isspace(*bf); bf++)
|
for (; *bf && Isspace(*bf); bf++)
|
||||||
continue;
|
continue;
|
||||||
@ -356,7 +356,7 @@ tw_result(const Char *act, Char **pat)
|
|||||||
res = Strsave(act);
|
res = Strsave(act);
|
||||||
if ((p = Strchr(&res[1], '`')) != NULL)
|
if ((p = Strchr(&res[1], '`')) != NULL)
|
||||||
*++p = '\0';
|
*++p = '\0';
|
||||||
|
|
||||||
if (didfds == 0) {
|
if (didfds == 0) {
|
||||||
/*
|
/*
|
||||||
* Make sure that we have some file descriptors to
|
* Make sure that we have some file descriptors to
|
||||||
@ -504,7 +504,7 @@ tw_complete(const Char *line, Char **word, Char **pat, int looking, eChar *suf)
|
|||||||
wordno++;
|
wordno++;
|
||||||
}
|
}
|
||||||
wl[wordno] = NULL;
|
wl[wordno] = NULL;
|
||||||
|
|
||||||
|
|
||||||
#ifdef TDEBUG
|
#ifdef TDEBUG
|
||||||
xprintf("\r\n");
|
xprintf("\r\n");
|
||||||
@ -515,7 +515,7 @@ tw_complete(const Char *line, Char **word, Char **pat, int looking, eChar *suf)
|
|||||||
xprintf("last: %s\n", wordno >= 2 ? short2str(wl[wordno-2]) : "n/a");
|
xprintf("last: %s\n", wordno >= 2 ? short2str(wl[wordno-2]) : "n/a");
|
||||||
xprintf("this: %s\n", wordno >= 1 ? short2str(wl[wordno-1]) : "n/a");
|
xprintf("this: %s\n", wordno >= 1 ? short2str(wl[wordno-1]) : "n/a");
|
||||||
#endif /* TDEBUG */
|
#endif /* TDEBUG */
|
||||||
|
|
||||||
for (;vec != NULL && (ptr = vec[0]) != NULL; vec++) {
|
for (;vec != NULL && (ptr = vec[0]) != NULL; vec++) {
|
||||||
Char *ran, /* The pattern or range X/<range>/XXXX/ */
|
Char *ran, /* The pattern or range X/<range>/XXXX/ */
|
||||||
*com, /* The completion X/XXXXX/<completion>/ */
|
*com, /* The completion X/XXXXX/<completion>/ */
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
#define DEFAULTLIST ":/usr/man/cat1:/usr/man/cat8:/usr/man/cat6:/usr/local/man/cat1:/usr/local/man/cat8:/usr/local/man/cat6" /* if no HPATH */
|
#define DEFAULTLIST ":/usr/man/cat1:/usr/man/cat8:/usr/man/cat6:/usr/local/man/cat1:/usr/local/man/cat8:/usr/local/man/cat6" /* if no HPATH */
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LIST, LIST_ALL, RECOGNIZE, RECOGNIZE_ALL, RECOGNIZE_SCROLL,
|
LIST, LIST_ALL, RECOGNIZE, RECOGNIZE_ALL, RECOGNIZE_SCROLL,
|
||||||
PRINT_HELP, SPELL, GLOB, GLOB_EXPAND, VARS_EXPAND, PATH_NORMALIZE,
|
PRINT_HELP, SPELL, GLOB, GLOB_EXPAND, VARS_EXPAND, PATH_NORMALIZE,
|
||||||
COMMAND_NORMALIZE
|
COMMAND_NORMALIZE
|
||||||
} COMMAND;
|
} COMMAND;
|
||||||
|
@ -323,7 +323,7 @@ tw_cmd_sort(void)
|
|||||||
for (i = 0, fwd = 0; i + 1 < tw_cmd.nlist; i++) {
|
for (i = 0, fwd = 0; i + 1 < tw_cmd.nlist; i++) {
|
||||||
if (Strcmp(tw_cmd.list[i], tw_cmd.list[i + 1]) == 0) /* garbage */
|
if (Strcmp(tw_cmd.list[i], tw_cmd.list[i + 1]) == 0) /* garbage */
|
||||||
fwd++; /* increase the forward ref. count */
|
fwd++; /* increase the forward ref. count */
|
||||||
else if (fwd)
|
else if (fwd)
|
||||||
tw_cmd.list[i - fwd] = tw_cmd.list[i];
|
tw_cmd.list[i - fwd] = tw_cmd.list[i];
|
||||||
}
|
}
|
||||||
/* Fix fencepost error -- Theodore Ts'o <tytso@athena.mit.edu> */
|
/* Fix fencepost error -- Theodore Ts'o <tytso@athena.mit.edu> */
|
||||||
@ -374,7 +374,7 @@ tw_cmd_start(DIR *dfd, const Char *pat)
|
|||||||
else
|
else
|
||||||
tw_cmd_state.pathv = defpath;
|
tw_cmd_state.pathv = defpath;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tw_cmd_state.pathv = defpath;
|
tw_cmd_state.pathv = defpath;
|
||||||
} /* tw_cmd_start */
|
} /* tw_cmd_start */
|
||||||
|
|
||||||
@ -589,7 +589,7 @@ tw_var_next(struct Strbuf *res, struct Strbuf *dir, int *flags)
|
|||||||
* Initialize lognames to the beginning of the list
|
* Initialize lognames to the beginning of the list
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
tw_logname_start(DIR *dfd, const Char *pat)
|
tw_logname_start(DIR *dfd, const Char *pat)
|
||||||
{
|
{
|
||||||
USE(pat);
|
USE(pat);
|
||||||
@ -655,7 +655,7 @@ tw_logname_end(void)
|
|||||||
* Initialize grpnames to the beginning of the list
|
* Initialize grpnames to the beginning of the list
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
tw_grpname_start(DIR *dfd, const Char *pat)
|
tw_grpname_start(DIR *dfd, const Char *pat)
|
||||||
{
|
{
|
||||||
USE(pat);
|
USE(pat);
|
||||||
@ -736,7 +736,7 @@ tw_file_start(DIR *dfd, const Char *pat)
|
|||||||
|
|
||||||
|
|
||||||
/* tw_file_next():
|
/* tw_file_next():
|
||||||
* Return the next file in the directory
|
* Return the next file in the directory
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
tw_file_next(struct Strbuf *res, struct Strbuf *dir, int *flags)
|
tw_file_next(struct Strbuf *res, struct Strbuf *dir, int *flags)
|
||||||
@ -783,8 +783,8 @@ tw_item_free(void)
|
|||||||
} /* end tw_item_free */
|
} /* end tw_item_free */
|
||||||
|
|
||||||
|
|
||||||
/* tw_item_get():
|
/* tw_item_get():
|
||||||
* Return the list of items
|
* Return the list of items
|
||||||
*/
|
*/
|
||||||
Char **
|
Char **
|
||||||
tw_item_get(void)
|
tw_item_get(void)
|
||||||
@ -807,7 +807,7 @@ tw_item_add(const struct Strbuf *s)
|
|||||||
|
|
||||||
|
|
||||||
/* tw_item_find():
|
/* tw_item_find():
|
||||||
* Find the string if it exists in the item list
|
* Find the string if it exists in the item list
|
||||||
* end return it.
|
* end return it.
|
||||||
*/
|
*/
|
||||||
Char *
|
Char *
|
||||||
@ -1016,7 +1016,7 @@ tw_job_next(struct Strbuf *res, struct Strbuf *dir, int *flags)
|
|||||||
for (j = proclist.p_next; j != NULL; j = j->p_next)
|
for (j = proclist.p_next; j != NULL; j = j->p_next)
|
||||||
if (j->p_index == tw_index && j->p_procid == j->p_jobid)
|
if (j->p_index == tw_index && j->p_procid == j->p_jobid)
|
||||||
break;
|
break;
|
||||||
if (j == NULL)
|
if (j == NULL)
|
||||||
continue;
|
continue;
|
||||||
Strbuf_append(res, j->p_command);
|
Strbuf_append(res, j->p_command);
|
||||||
tw_index++;
|
tw_index++;
|
||||||
|
@ -54,25 +54,25 @@
|
|||||||
/* TW_BINDING, TW_WORDLIST, TW_LIMIT, TW_SIGNAL */
|
/* TW_BINDING, TW_WORDLIST, TW_LIMIT, TW_SIGNAL */
|
||||||
/* TW_JOB, TW_EXPLAIN, TW_TEXT, TW_GRPNAME */
|
/* TW_JOB, TW_EXPLAIN, TW_TEXT, TW_GRPNAME */
|
||||||
static void (*const tw_start_entry[]) (DIR *, const Char *) = {
|
static void (*const tw_start_entry[]) (DIR *, const Char *) = {
|
||||||
tw_file_start, tw_cmd_start, tw_var_start, tw_logname_start,
|
tw_file_start, tw_cmd_start, tw_var_start, tw_logname_start,
|
||||||
tw_file_start, tw_file_start, tw_vl_start, tw_logname_start,
|
tw_file_start, tw_file_start, tw_vl_start, tw_logname_start,
|
||||||
tw_complete_start, tw_alias_start, tw_var_start, tw_var_start,
|
tw_complete_start, tw_alias_start, tw_var_start, tw_var_start,
|
||||||
tw_bind_start, tw_wl_start, tw_limit_start, tw_sig_start,
|
tw_bind_start, tw_wl_start, tw_limit_start, tw_sig_start,
|
||||||
tw_job_start, tw_file_start, tw_file_start, tw_grpname_start
|
tw_job_start, tw_file_start, tw_file_start, tw_grpname_start
|
||||||
};
|
};
|
||||||
|
|
||||||
static int (*const tw_next_entry[]) (struct Strbuf *, struct Strbuf *,
|
static int (*const tw_next_entry[]) (struct Strbuf *, struct Strbuf *,
|
||||||
int *) = {
|
int *) = {
|
||||||
tw_file_next, tw_cmd_next, tw_var_next, tw_logname_next,
|
tw_file_next, tw_cmd_next, tw_var_next, tw_logname_next,
|
||||||
tw_file_next, tw_file_next, tw_var_next, tw_logname_next,
|
tw_file_next, tw_file_next, tw_var_next, tw_logname_next,
|
||||||
tw_var_next, tw_var_next, tw_shvar_next, tw_envvar_next,
|
tw_var_next, tw_var_next, tw_shvar_next, tw_envvar_next,
|
||||||
tw_bind_next, tw_wl_next, tw_limit_next, tw_sig_next,
|
tw_bind_next, tw_wl_next, tw_limit_next, tw_sig_next,
|
||||||
tw_job_next, tw_file_next, tw_file_next, tw_grpname_next
|
tw_job_next, tw_file_next, tw_file_next, tw_grpname_next
|
||||||
};
|
};
|
||||||
|
|
||||||
static void (*const tw_end_entry[]) (void) = {
|
static void (*const tw_end_entry[]) (void) = {
|
||||||
tw_dir_end, tw_dir_end, tw_dir_end, tw_logname_end,
|
tw_dir_end, tw_dir_end, tw_dir_end, tw_logname_end,
|
||||||
tw_dir_end, tw_dir_end, tw_dir_end, tw_logname_end,
|
tw_dir_end, tw_dir_end, tw_dir_end, tw_logname_end,
|
||||||
tw_dir_end, tw_dir_end, tw_dir_end, tw_dir_end,
|
tw_dir_end, tw_dir_end, tw_dir_end, tw_dir_end,
|
||||||
tw_dir_end, tw_dir_end, tw_dir_end, tw_dir_end,
|
tw_dir_end, tw_dir_end, tw_dir_end, tw_dir_end,
|
||||||
tw_dir_end, tw_dir_end, tw_dir_end, tw_grpname_end
|
tw_dir_end, tw_dir_end, tw_dir_end, tw_grpname_end
|
||||||
@ -447,7 +447,7 @@ tenematch(Char *inputline, int num_read, COMMAND command)
|
|||||||
int found;
|
int found;
|
||||||
|
|
||||||
found = cmd_expand(qline.s + wordp, &p);
|
found = cmd_expand(qline.s + wordp, &p);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
xfree(p);
|
xfree(p);
|
||||||
search_ret = 0;
|
search_ret = 0;
|
||||||
@ -527,14 +527,14 @@ t_glob(Char ***v, int cmd)
|
|||||||
Char **av = *v, *p;
|
Char **av = *v, *p;
|
||||||
int fwd, i;
|
int fwd, i;
|
||||||
|
|
||||||
for (i = 0, fwd = 0; av[i] != NULL; i++)
|
for (i = 0, fwd = 0; av[i] != NULL; i++)
|
||||||
if (!executable(NULL, av[i], 0)) {
|
if (!executable(NULL, av[i], 0)) {
|
||||||
fwd++;
|
fwd++;
|
||||||
p = av[i];
|
p = av[i];
|
||||||
av[i] = NULL;
|
av[i] = NULL;
|
||||||
xfree(p);
|
xfree(p);
|
||||||
}
|
}
|
||||||
else if (fwd)
|
else if (fwd)
|
||||||
av[i - fwd] = av[i];
|
av[i - fwd] = av[i];
|
||||||
|
|
||||||
if (fwd)
|
if (fwd)
|
||||||
@ -714,13 +714,13 @@ is_prefixmatch(Char *check, Char *template, int enhanced)
|
|||||||
if ((*check & TRIM) != (*template & TRIM)) {
|
if ((*check & TRIM) != (*template & TRIM)) {
|
||||||
MCH1 = (*check & TRIM);
|
MCH1 = (*check & TRIM);
|
||||||
MCH2 = (*template & TRIM);
|
MCH2 = (*template & TRIM);
|
||||||
LCH1 = Isupper(MCH1) ? Tolower(MCH1) :
|
LCH1 = Isupper(MCH1) ? Tolower(MCH1) :
|
||||||
enhanced == 2 && MCH1 == '_' ? '-' : MCH1;
|
enhanced == 2 && MCH1 == '_' ? '-' : MCH1;
|
||||||
LCH2 = Isupper(MCH2) ? Tolower(MCH2) :
|
LCH2 = Isupper(MCH2) ? Tolower(MCH2) :
|
||||||
enhanced == 2 && MCH2 == '_' ? '-' : MCH2;
|
enhanced == 2 && MCH2 == '_' ? '-' : MCH2;
|
||||||
if (MCH1 != MCH2 && MCH1 != LCH2 &&
|
if (MCH1 != MCH2 && MCH1 != LCH2 &&
|
||||||
(LCH1 != MCH2 || enhanced == 2)) {
|
(LCH1 != MCH2 || enhanced == 2)) {
|
||||||
if (enhanced && ((*check & TRIM) == '-' ||
|
if (enhanced && ((*check & TRIM) == '-' ||
|
||||||
(*check & TRIM) == '.' ||
|
(*check & TRIM) == '.' ||
|
||||||
(*check & TRIM) == '_')) {
|
(*check & TRIM) == '_')) {
|
||||||
MCH1 = MCH2 = (*check & TRIM);
|
MCH1 = MCH2 = (*check & TRIM);
|
||||||
@ -814,7 +814,7 @@ starting_a_command(Char *wordstart, Char *inputline)
|
|||||||
* look for the characters previous to this word if we find a command
|
* look for the characters previous to this word if we find a command
|
||||||
* starting delimiter we break. if we find whitespace and another previous
|
* starting delimiter we break. if we find whitespace and another previous
|
||||||
* word then we are not a command
|
* word then we are not a command
|
||||||
*
|
*
|
||||||
* count is our state machine: 0 looking for anything 1 found white-space
|
* count is our state machine: 0 looking for anything 1 found white-space
|
||||||
* looking for non-ws
|
* looking for non-ws
|
||||||
*/
|
*/
|
||||||
@ -952,7 +952,7 @@ tw_collect_items(COMMAND command, int looking, struct Strbuf *exp_dir,
|
|||||||
|
|
||||||
showdots = DOT_NONE;
|
showdots = DOT_NONE;
|
||||||
if ((ptr = varval(STRlistflags)) != STRNULL)
|
if ((ptr = varval(STRlistflags)) != STRNULL)
|
||||||
while (*ptr)
|
while (*ptr)
|
||||||
switch (*ptr++) {
|
switch (*ptr++) {
|
||||||
case 'a':
|
case 'a':
|
||||||
showdots = DOT_ALL;
|
showdots = DOT_ALL;
|
||||||
@ -1159,7 +1159,7 @@ tw_collect_items(COMMAND command, int looking, struct Strbuf *exp_dir,
|
|||||||
numitems++;
|
numitems++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == RECOGNIZE || command == RECOGNIZE_ALL ||
|
if (command == RECOGNIZE || command == RECOGNIZE_ALL ||
|
||||||
command == RECOGNIZE_SCROLL) {
|
command == RECOGNIZE_SCROLL) {
|
||||||
if (ignoring && ignored(item.s)) {
|
if (ignoring && ignored(item.s)) {
|
||||||
@ -1220,7 +1220,7 @@ tw_collect_items(COMMAND command, int looking, struct Strbuf *exp_dir,
|
|||||||
if (command == SPELL)
|
if (command == SPELL)
|
||||||
return d;
|
return d;
|
||||||
else {
|
else {
|
||||||
if (ignoring && numitems == 0 && nignored > 0)
|
if (ignoring && numitems == 0 && nignored > 0)
|
||||||
return -nignored;
|
return -nignored;
|
||||||
else
|
else
|
||||||
return numitems;
|
return numitems;
|
||||||
@ -1252,13 +1252,13 @@ tw_suffix(int looking, struct Strbuf *word, const Char *exp_dir, Char *exp_name)
|
|||||||
*/
|
*/
|
||||||
if ((vp = adrof(exp_name)) != NULL && vp->vec != NULL) {
|
if ((vp = adrof(exp_name)) != NULL && vp->vec != NULL) {
|
||||||
if ((ptr = vp->vec[0]) == NULL || *ptr == '\0' ||
|
if ((ptr = vp->vec[0]) == NULL || *ptr == '\0' ||
|
||||||
vp->vec[1] != NULL)
|
vp->vec[1] != NULL)
|
||||||
return ' ';
|
return ' ';
|
||||||
}
|
}
|
||||||
else if ((ptr = tgetenv(exp_name)) == NULL || *ptr == '\0')
|
else if ((ptr = tgetenv(exp_name)) == NULL || *ptr == '\0')
|
||||||
return ' ';
|
return ' ';
|
||||||
|
|
||||||
if ((dol = Strrchr(word->s, '$')) != 0 &&
|
if ((dol = Strrchr(word->s, '$')) != 0 &&
|
||||||
dol[1] == '{' && Strchr(dol, '}') == NULL)
|
dol[1] == '{' && Strchr(dol, '}') == NULL)
|
||||||
return '}';
|
return '}';
|
||||||
|
|
||||||
@ -1544,7 +1544,7 @@ t_search(struct Strbuf *word, COMMAND command, int looking, int list_max,
|
|||||||
target = name;
|
target = name;
|
||||||
gpat = 0; /* Override pattern mechanism */
|
gpat = 0; /* Override pattern mechanism */
|
||||||
}
|
}
|
||||||
else if ((target = Strrchr(name, '$')) != 0 &&
|
else if ((target = Strrchr(name, '$')) != 0 &&
|
||||||
(target[1] != '{' || Strchr(target, '}') == NULL) &&
|
(target[1] != '{' || Strchr(target, '}') == NULL) &&
|
||||||
(Strchr(name, '/') == NULL)) {
|
(Strchr(name, '/') == NULL)) {
|
||||||
target++;
|
target++;
|
||||||
@ -1781,7 +1781,7 @@ t_search(struct Strbuf *word, COMMAND command, int looking, int list_max,
|
|||||||
case RECOGNIZE:
|
case RECOGNIZE:
|
||||||
case RECOGNIZE_ALL:
|
case RECOGNIZE_ALL:
|
||||||
case RECOGNIZE_SCROLL:
|
case RECOGNIZE_SCROLL:
|
||||||
if (numitems <= 0)
|
if (numitems <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Strbuf_terminate(&exp_name);
|
Strbuf_terminate(&exp_name);
|
||||||
@ -2164,8 +2164,8 @@ print_by_column(Char *dir, Char *items[], int count, int no_file_suffix)
|
|||||||
|
|
||||||
lbuffed = 0; /* turn off line buffering */
|
lbuffed = 0; /* turn off line buffering */
|
||||||
|
|
||||||
|
|
||||||
across = ((val = varval(STRlistflags)) != STRNULL) &&
|
across = ((val = varval(STRlistflags)) != STRNULL) &&
|
||||||
(Strchr(val, 'x') != NULL);
|
(Strchr(val, 'x') != NULL);
|
||||||
|
|
||||||
for (i = 0; i < count; i++) { /* find widest string */
|
for (i = 0; i < count; i++) { /* find widest string */
|
||||||
@ -2237,7 +2237,7 @@ print_by_column(Char *dir, Char *items[], int count, int no_file_suffix)
|
|||||||
int
|
int
|
||||||
StrQcmp(const Char *str1, const Char *str2)
|
StrQcmp(const Char *str1, const Char *str2)
|
||||||
{
|
{
|
||||||
for (; *str1 && samecase(*str1 & TRIM) == samecase(*str2 & TRIM);
|
for (; *str1 && samecase(*str1 & TRIM) == samecase(*str2 & TRIM);
|
||||||
str1++, str2++)
|
str1++, str2++)
|
||||||
continue;
|
continue;
|
||||||
/*
|
/*
|
||||||
|
@ -221,7 +221,7 @@ tgetstr(char *id, char **area)
|
|||||||
cp++;
|
cp++;
|
||||||
if (*cp != '=')
|
if (*cp != '=')
|
||||||
return(NULL);
|
return(NULL);
|
||||||
for (ret = *area, cp++; *cp && *cp != ':' ;
|
for (ret = *area, cp++; *cp && *cp != ':' ;
|
||||||
(*area)++, cp++)
|
(*area)++, cp++)
|
||||||
switch(*cp) {
|
switch(*cp) {
|
||||||
case '^' :
|
case '^' :
|
||||||
|
Loading…
Reference in New Issue
Block a user