From crahman at gmail.com Sat Oct 17 01:00:54 2009 From: crahman at gmail.com (Cyrus Rahman) Date: Fri, 16 Oct 2009 16:00:54 -0600 Subject: REMOTEHOST not set when strlen(hostname) == UT_HOSTSIZE Message-ID: <9e77bdb50910161500l27107b25k1fb1ae7ade17203f@mail.gmail.com> This is on tcsh 6.17.00 (Astron) 2009-07-10 (i386-intel-FreeBSD) options wide,nls,dl,al,kan,sm,rh,color,filec: When you log in from a host the name of which is of length UT_HOSTSIZE, REMOTEHOST is not set. Looking into the code in tc.func.c I suspect the following patch would solve the problem: --- /usr/src/contrib/tcsh/tc.func.c 2009-07-10 23:35:08.000000000 -0600 +++ tc.func.c 2009-10-16 15:46:33.000000000 -0600 @@ -1928,7 +1928,7 @@ (ptr = strstr(domain, s)) != NULL) { char *cbuf; - cbuf = strspl(name, ptr); + cbuf = strspl(name, ptr + strlen(s)); if (getaddrinfo(cbuf, NULL, &hints, &res) != 0) res = NULL; xfree(cbuf); From christos at zoulas.com Sat Oct 17 18:23:56 2009 From: christos at zoulas.com (Christos Zoulas) Date: Sat, 17 Oct 2009 11:23:56 -0400 Subject: REMOTEHOST not set when strlen(hostname) == UT_HOSTSIZE In-Reply-To: <9e77bdb50910161500l27107b25k1fb1ae7ade17203f@mail.gmail.com> from Cyrus Rahman (Oct 16, 4:00pm) Message-ID: <20091017152356.C04425654E@rebar.astron.com> On Oct 16, 4:00pm, crahman at gmail.com (Cyrus Rahman) wrote: -- Subject: REMOTEHOST not set when strlen(hostname) == UT_HOSTSIZE | This is on tcsh 6.17.00 (Astron) 2009-07-10 (i386-intel-FreeBSD) | options wide,nls,dl,al,kan,sm,rh,color,filec: | | When you log in from a host the name of which is of length | UT_HOSTSIZE, REMOTEHOST is not set. Looking into the code in | tc.func.c I suspect the following patch would solve the problem: | | --- /usr/src/contrib/tcsh/tc.func.c 2009-07-10 23:35:08.000000000 -0600 | +++ tc.func.c 2009-10-16 15:46:33.000000000 -0600 | @@ -1928,7 +1928,7 @@ | (ptr = strstr(domain, s)) != NULL) { | char *cbuf; | | - cbuf = strspl(name, ptr); | + cbuf = strspl(name, ptr + strlen(s)); | if (getaddrinfo(cbuf, NULL, &hints, &res) != 0) | res = NULL; | xfree(cbuf); Thanks, I've applied the patch. christos From mander at sympatico.ca Mon Oct 26 04:42:51 2009 From: mander at sympatico.ca (M.H. Anderson) Date: Sun, 25 Oct 2009 22:42:51 -0400 Subject: Minor colorls bug in tcsh-6.17.00 Message-ID: <4AE50CAB.4040507@sympatico.ca> Attached is a patch for tw.color.c. It adds two colorls variables which are in the default color database of the dircolors utility from GNU coreutils v7.1. This avoids startup errors when LS_COLORS has been set using this utility. Having a setting for "hl" is useful, although I am not quite sure what the "ca" variable is. The color values set by the patch are the same as the defaults for dircolors. ---------------------------------- --- ./tcsh-6.17.00/tw.color.c.orig 2008-10-17 15:57:33.000000000 -0400 +++ ./tcsh-6.17.00/tw.color.c 2009-10-25 21:26:44.000000000 -0400 @@ -86,6 +86,8 @@ VAR(NOS, "ow", ""), /* Other writable dir (o+w) but not sticky */ VAR(NOS, "st", ""), /* Sticky dir (+t) but not other writable */ VAR(NOS, "rs", "0"), /* Reset to normal color */ + VAR(NOS, "hl", "44;37"), /* Reg file extra hard links */ + VAR(NOS, "ca", "30;41"), /* File with capability */ }; enum FileType { ------------------------- Michael H. Anderson -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: pat6.17_lscolor URL: From christos at zoulas.com Mon Oct 26 19:34:30 2009 From: christos at zoulas.com (Christos Zoulas) Date: Mon, 26 Oct 2009 13:34:30 -0400 Subject: Minor colorls bug in tcsh-6.17.00 In-Reply-To: <4AE50CAB.4040507@sympatico.ca> from "M.H. Anderson" (Oct 25, 10:42pm) Message-ID: <20091026173430.50FBC56551@rebar.astron.com> On Oct 25, 10:42pm, mander at sympatico.ca ("M.H. Anderson") wrote: -- Subject: Minor colorls bug in tcsh-6.17.00 | Attached is a patch for tw.color.c. It adds two colorls | variables which are in the default color database of | the dircolors utility from GNU coreutils v7.1. | | This avoids startup errors when LS_COLORS has been set | using this utility. | | Having a setting for "hl" is useful, although I am not quite sure | what the "ca" variable is. | | The color values set by the patch are the same as the defaults for | dircolors. Thanks! christos From ldarby at tuffmail.com Mon Oct 26 23:48:48 2009 From: ldarby at tuffmail.com (Laurence Darby) Date: Mon, 26 Oct 2009 21:48:48 +0000 Subject: Minor colorls bug in tcsh-6.17.00 In-Reply-To: <20091026173430.50FBC56551@rebar.astron.com> References: <4AE50CAB.4040507@sympatico.ca> <20091026173430.50FBC56551@rebar.astron.com> Message-ID: <20091026214848.2d7fd43c.ldarby@tuffmail.com> Christos Zoulas wrote: > On Oct 25, 10:42pm, mander at sympatico.ca ("M.H. Anderson") wrote: > -- Subject: Minor colorls bug in tcsh-6.17.00 > > | Attached is a patch for tw.color.c. It adds two colorls > | variables which are in the default color database of > | the dircolors utility from GNU coreutils v7.1. > | > | This avoids startup errors when LS_COLORS has been set > | using this utility. > | > | Having a setting for "hl" is useful, although I am not quite > | sure what the "ca" variable is. > | > | The color values set by the patch are the same as the defaults > | for dircolors. > > Thanks! Also what about Vitezslav Crhonek's patch in Subject: colorls variables, Date: 24 Aug 2009 ? It's much more future proof. Laurence From mikets at frontline-pcb.com Thu Oct 29 14:42:46 2009 From: mikets at frontline-pcb.com (Michael Tseitlin) Date: Thu, 29 Oct 2009 14:42:46 +0200 Subject: tcsh 6.17 compilation on VS 2005 fails Message-ID: <075C2566E08D19449B32D97E2798A3E71CC891BD2B@usa.FRONTLINE-PCB.COM> Hi, I get the following errors (my computer is Win XP 64 bits but I compile in 32-bit mode): cl -c -nologo -MT -Zi -O2 -I. -I.. -Iwin32 -WX -W3 -DWINNT_NATIVE -DNO_CRYPT -DHAVE_DIRENT_H sh.c sh.c c:\tmp\tcsh-6.17.00\sh.h(119) : error C2220: warning treated as error - no 'object' file generated c:\tmp\tcsh-6.17.00\sh.h(119) : warning C4005: 'IGNORE' : macro redefinition c:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\winbase.h(821) : see previous definition of 'IGNORE' c:\tmp\tcsh-6.17.00\sh.h(120) : error C2054: expected '(' to follow 'inline' c:\tmp\tcsh-6.17.00\sh.h(121) : error C2085: 'ignore' : not in formal parameter list c:\tmp\tcsh-6.17.00\sh.h(121) : error C2143: syntax error : missing ';' before '{' Thanks, Michael From christos at zoulas.com Thu Oct 29 15:06:10 2009 From: christos at zoulas.com (Christos Zoulas) Date: Thu, 29 Oct 2009 09:06:10 -0400 Subject: tcsh 6.17 compilation on VS 2005 fails In-Reply-To: <075C2566E08D19449B32D97E2798A3E71CC891BD2B@usa.FRONTLINE-PCB.COM> from Michael Tseitlin (Oct 29, 2:42pm) Message-ID: <20091029130610.36D935654E@rebar.astron.com> On Oct 29, 2:42pm, mikets at frontline-pcb.com (Michael Tseitlin) wrote: -- Subject: tcsh 6.17 compilation on VS 2005 fails | Hi, | | I get the following errors (my computer is Win XP 64 bits but I compile in 32-bit mode): | | cl -c -nologo -MT -Zi -O2 -I. -I.. -Iwin32 -WX -W3 -DWINNT_NATIVE -DNO_CRYPT -DHAVE_DIRENT_H sh.c | sh.c | c:\tmp\tcsh-6.17.00\sh.h(119) : error C2220: warning treated as error - no 'object' file generated | c:\tmp\tcsh-6.17.00\sh.h(119) : warning C4005: 'IGNORE' : macro redefinition | c:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\include\winbase.h(821) : see previous definition of 'IGNORE' | c:\tmp\tcsh-6.17.00\sh.h(120) : error C2054: expected '(' to follow 'inline' | c:\tmp\tcsh-6.17.00\sh.h(121) : error C2085: 'ignore' : not in formal parameter list | c:\tmp\tcsh-6.17.00\sh.h(121) : error C2143: syntax error : missing ';' before '{' Try changing IGNORE -> TCSH_IGNORE everywhere. This is what I did. christos From jbastian at redhat.com Fri Oct 30 02:38:52 2009 From: jbastian at redhat.com (Jeff Bastian) Date: Thu, 29 Oct 2009 19:38:52 -0500 (CDT) Subject: tcsh printexitvalue query Message-ID: On Jun 8 2006 16:13:33 EEST, Christos Zoulas wrote: > On Jun 8 2006 03:58:29 EEST, Ben Hall wrote: > > An example of the current behavour (Kubuntu 5.10 - tcsh 6.14.00): > > > > # set printexitvalue;echo X"`echo foo | grep bar`"X > > XExit 1X > > Exit 1 > > > > Why has this behavior changed? Is it intentional? > > No this is not intentional. Builtins in the foreground should do it, > but not in ``. This is still a bug with tcsh-6.17.00 from July 2009. Attached is a patch to fix it. With this patch, the above command now does: # set printexitvalue # echo X"`echo foo | grep bar`"X XX Exit 1 # I've also reported this for Fedora 11 at https://bugzilla.redhat.com/show_bug.cgi?id=531957 Jeff Bastian -------------- next part -------------- diff --git a/sh.glob.c b/sh.glob.c index 6ee5ecc..82e5801 100644 --- a/sh.glob.c +++ b/sh.glob.c @@ -776,6 +776,10 @@ backeval(struct blk_buf *bb, struct Strbuf *word, Char *cp, int literal) alias(¶ml); t = syntax(paraml.next, ¶ml, 0); cleanup_push(t, syntax_cleanup); + /* The F_BACKQ flag must set so the job output is correct if + * printexitvalue is set. If it's not set, the job output + * will have "Exit N" appended where N is the exit status. */ + t->t_dflg = F_BACKQ; if (seterr) stderror(ERR_OLD); #ifdef SIGTSTP diff --git a/sh.sem.c b/sh.sem.c index c9e2581..440e7db 100644 --- a/sh.sem.c +++ b/sh.sem.c @@ -664,31 +664,31 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout, #endif /* !CLOSE_ON_EXEC */ didfds = 0; wanttty = -1; - t->t_dspr->t_dflg |= t->t_dflg & F_NOINTERRUPT; + t->t_dspr->t_dflg |= t->t_dflg & (F_NOINTERRUPT | F_BACKQ); execute(t->t_dspr, wanttty, NULL, NULL, do_glob); exitstat(); case NODE_PIPE: #ifdef BACKPIPE t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg & - (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT)); + (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT | F_BACKQ)); execute(t->t_dcdr, wanttty, pv, pipeout, do_glob); - t->t_dcar->t_dflg |= F_PIPEOUT | - (t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT)); + t->t_dcar->t_dflg |= F_PIPEOUT | (t->t_dflg & + (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT | F_BACKQ)); execute(t->t_dcar, wanttty, pipein, pv, do_glob); #else /* !BACKPIPE */ - t->t_dcar->t_dflg |= F_PIPEOUT | - (t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT)); + t->t_dcar->t_dflg |= F_PIPEOUT | (t->t_dflg & + (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT | F_BACKQ)); execute(t->t_dcar, wanttty, pipein, pv, do_glob); t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg & - (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT)); + (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT | F_BACKQ)); execute(t->t_dcdr, wanttty, pv, pipeout, do_glob); #endif /* BACKPIPE */ break; case NODE_LIST: if (t->t_dcar) { - t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT; + t->t_dcar->t_dflg |= t->t_dflg & (F_NOINTERRUPT | F_BACKQ); execute(t->t_dcar, wanttty, NULL, NULL, do_glob); /* * In strange case of A&B make a new job after A @@ -699,7 +699,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout, } if (t->t_dcdr) { t->t_dcdr->t_dflg |= t->t_dflg & - (F_NOFORK | F_NOINTERRUPT); + (F_NOFORK | F_NOINTERRUPT | F_BACKQ); execute(t->t_dcdr, wanttty, NULL, NULL, do_glob); } break; @@ -707,7 +707,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout, case NODE_OR: case NODE_AND: if (t->t_dcar) { - t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT; + t->t_dcar->t_dflg |= t->t_dflg & (F_NOINTERRUPT | F_BACKQ); execute(t->t_dcar, wanttty, NULL, NULL, do_glob); if ((getn(varval(STRstatus)) == 0) != (t->t_dtyp == NODE_AND)) { @@ -716,7 +716,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout, } if (t->t_dcdr) { t->t_dcdr->t_dflg |= t->t_dflg & - (F_NOFORK | F_NOINTERRUPT); + (F_NOFORK | F_NOINTERRUPT | F_BACKQ); execute(t->t_dcdr, wanttty, NULL, NULL, do_glob); } break; From christos at zoulas.com Fri Oct 30 16:27:44 2009 From: christos at zoulas.com (Christos Zoulas) Date: Fri, 30 Oct 2009 10:27:44 -0400 Subject: tcsh printexitvalue query In-Reply-To: from Jeff Bastian (Oct 29, 7:38pm) Message-ID: <20091030142744.891C55654F@rebar.astron.com> On Oct 29, 7:38pm, jbastian at redhat.com (Jeff Bastian) wrote: -- Subject: Re: tcsh printexitvalue query | This is still a bug with tcsh-6.17.00 from July 2009. Attached is a patch | to fix it. | | With this patch, the above command now does: | # set printexitvalue | # echo X"`echo foo | grep bar`"X | XX | Exit 1 | # | | I've also reported this for Fedora 11 at | https://bugzilla.redhat.com/show_bug.cgi?id=531957 | | Jeff Bastian Thanks a lot, applied. christos