"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "sh.set.c" between
tcsh-6.22.02.tar.gz and tcsh-6.22.03.tar.gz

About: Tcsh is a version of the Berkeley C-Shell, with the addition of: A command line editor, command and file name completion, listing, ...

sh.set.c  (tcsh-6.22.02):sh.set.c  (tcsh-6.22.03)
skipping to change at line 149 skipping to change at line 149
editing = 1; editing = 1;
noediting = 0; noediting = 0;
setNS(STRedit); setNS(STRedit);
} }
ed_Init(); /* reset the editor */ ed_Init(); /* reset the editor */
} }
else if (eq(vp, STRhome)) { else if (eq(vp, STRhome)) {
Char *cp, *canon; Char *cp, *canon;
cp = Strsave(varval(vp)); /* get the old value back */ cp = Strsave(varval(vp)); /* get the old value back */
cleanup_push(cp, xfree);
/* /*
* convert to cononical pathname (possibly resolving symlinks) * convert to cononical pathname (possibly resolving symlinks)
*/ */
canon = dcanon(cp, cp); canon = dcanon(cp, cp);
cleanup_ignore(cp);
cleanup_until(cp);
cleanup_push(canon, xfree); cleanup_push(canon, xfree);
setcopy(vp, canon, VAR_READWRITE); /* have to save the new val */ setcopy(vp, canon, VAR_READWRITE); /* have to save the new val */
/* and now mirror home with HOME */ /* and now mirror home with HOME */
tsetenv(STRKHOME, canon); tsetenv(STRKHOME, canon);
/* fix directory stack for new tilde home */ /* fix directory stack for new tilde home */
dtilde(); dtilde();
cleanup_until(canon); cleanup_until(canon);
} }
skipping to change at line 662 skipping to change at line 658
set1(const Char *var, Char **vec, struct varent *head, int flags) set1(const Char *var, Char **vec, struct varent *head, int flags)
{ {
Char **oldv = vec; Char **oldv = vec;
if ((flags & VAR_NOGLOB) == 0) { if ((flags & VAR_NOGLOB) == 0) {
int gflag; int gflag;
gflag = tglob(oldv); gflag = tglob(oldv);
if (gflag) { if (gflag) {
vec = globall(oldv, gflag); vec = globall(oldv, gflag);
if (vec == 0) { if (vec == NULL) {
blkfree(oldv); blkfree(oldv);
stderror(ERR_NAME | ERR_NOMATCH); stderror(ERR_NAME | ERR_NOMATCH);
} }
blkfree(oldv); blkfree(oldv);
} }
} }
/* /*
* Uniqueness addition from: Michael Veksler <mveksler@vnet.ibm.com> * Uniqueness addition from: Michael Veksler <mveksler@vnet.ibm.com>
*/ */
if ( flags & (VAR_FIRST | VAR_LAST) ) { if ( flags & (VAR_FIRST | VAR_LAST) ) {
/* /*
* Code for -f (VAR_FIRST) and -l (VAR_LAST) options. * Code for -f (VAR_FIRST) and -l (VAR_LAST) options.
* Method: * Method:
* Delete all duplicate words leaving "holes" in the word array (vec). * Delete all duplicate words leaving "holes" in the word array (vec).
* Then remove the "holes", keeping the order of the words unchanged. * Then remove the "holes", keeping the order of the words unchanged.
*/ */
if (vec && vec[0] && vec[1]) { /* more than one word ? */ if (vec[0] && vec[1]) { /* more than one word ? */
int i, j; int i, j;
int num_items; int num_items;
for (num_items = 0; vec[num_items]; num_items++) for (num_items = 0; vec[num_items]; num_items++)
continue; continue;
if (flags & VAR_FIRST) { if (flags & VAR_FIRST) {
/* delete duplications, keeping first occurance */ /* delete duplications, keeping first occurance */
for (i = 1; i < num_items; i++) for (i = 1; i < num_items; i++)
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
/* If have earlier identical item, remove i'th item */ /* If have earlier identical item, remove i'th item */
 End of changes. 4 change blocks. 
6 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)