expand.c (45514) | expand.c (45644) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#ifndef lint 38#if 0 39static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; 40#endif 41static const char rcsid[] = | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#ifndef lint 38#if 0 39static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; 40#endif 41static const char rcsid[] = |
42 "$Id: expand.c,v 1.24 1998/09/13 19:24:57 tegge Exp $"; | 42 "$Id: expand.c,v 1.25 1999/04/09 15:23:48 tegge Exp $"; |
43#endif /* not lint */ 44 45#include <sys/types.h> 46#include <sys/time.h> 47#include <sys/stat.h> 48#include <errno.h> 49#include <dirent.h> 50#include <unistd.h> --- 590 unchanged lines hidden (view full) --- 641evalvar(p, flag) 642 char *p; 643 int flag; 644{ 645 int subtype; 646 int varflags; 647 char *var; 648 char *val; | 43#endif /* not lint */ 44 45#include <sys/types.h> 46#include <sys/time.h> 47#include <sys/stat.h> 48#include <errno.h> 49#include <dirent.h> 50#include <unistd.h> --- 590 unchanged lines hidden (view full) --- 641evalvar(p, flag) 642 char *p; 643 int flag; 644{ 645 int subtype; 646 int varflags; 647 char *var; 648 char *val; |
649 char *pat; | 649 int patloc; |
650 int c; 651 int set; 652 int special; 653 int startloc; 654 int varlen; 655 int easy; 656 int quotes = flag & (EXP_FULL | EXP_CASE); 657 --- 81 unchanged lines hidden (view full) --- 739 case VSTRIMRIGHTMAX: 740 if (!set) 741 break; 742 /* 743 * Terminate the string and start recording the pattern 744 * right after it 745 */ 746 STPUTC('\0', expdest); | 650 int c; 651 int set; 652 int special; 653 int startloc; 654 int varlen; 655 int easy; 656 int quotes = flag & (EXP_FULL | EXP_CASE); 657 --- 81 unchanged lines hidden (view full) --- 739 case VSTRIMRIGHTMAX: 740 if (!set) 741 break; 742 /* 743 * Terminate the string and start recording the pattern 744 * right after it 745 */ 746 STPUTC('\0', expdest); |
747 pat = expdest; 748 if (subevalvar(p, NULL, expdest - stackblock(), subtype, | 747 patloc = expdest - stackblock(); 748 if (subevalvar(p, NULL, patloc, subtype, |
749 startloc, varflags) == 0) { | 749 startloc, varflags) == 0) { |
750 int amount = (expdest - pat) + 1; | 750 int amount = (expdest - stackblock() - patloc) + 1; |
751 STADJUST(-amount, expdest); 752 } 753 /* Remove any recorded regions beyond start of variable */ 754 removerecordregions(startloc); 755 goto record; 756 757 case VSASSIGN: 758 case VSQUESTION: --- 801 unchanged lines hidden --- | 751 STADJUST(-amount, expdest); 752 } 753 /* Remove any recorded regions beyond start of variable */ 754 removerecordregions(startloc); 755 goto record; 756 757 case VSASSIGN: 758 case VSQUESTION: --- 801 unchanged lines hidden --- |