Symlink first step: variable renaming

Olson, Arthur David (NIH/NCI) [E] olsona at dc37a.nci.nih.gov
Mon Mar 26 17:56:03 UTC 2007


As a first step in dealing with the zic symlink matter, I'm suggesting
the variable renaming below.

				--ado


------- zic.c -------
*** /tmp/geta24885	Mon Mar 26 13:53:31 2007
--- /tmp/getb24885	Mon Mar 26 13:53:31 2007
***************
*** 3,9 ****
  ** 2006-07-17 by Arthur David Olson.
  */
  
! static char	elsieid[] = "@(#)zic.c	8.11";
  
  #include "private.h"
  #include "locale.h"
--- 3,9 ----
  ** 2006-07-17 by Arthur David Olson.
  */
  
! static char	elsieid[] = "@(#)zic.c	8.12";
  
  #include "private.h"
  #include "locale.h"
***************
*** 114,120 ****
  static int	ciequal P((const char * ap, const char * bp));
  static void	convert P((long val, char * buf));
  static void	convert64 P((zic_t val, char * buf));
! static void	dolink P((const char * fromfile, const char * tofile));
  static void	doabbr P((char * abbr, const char * format,
  			const char * letters, int isdst, int doquotes));
  static void	eat P((const char * name, int num));
--- 114,120 ----
  static int	ciequal P((const char * ap, const char * bp));
  static void	convert P((long val, char * buf));
  static void	convert64 P((zic_t val, char * buf));
! static void	dolink P((const char * fromfield, const char *
tofield));
  static void	doabbr P((char * abbr, const char * format,
  			const char * letters, int isdst, int doquotes));
  static void	eat P((const char * name, int num));
***************
*** 628,653 ****
  }
  
  static void
! dolink(fromfile, tofile)
! const char * const	fromfile;
! const char * const	tofile;
  {
  	register char *	fromname;
  	register char *	toname;
  
! 	if (fromfile[0] == '/')
! 		fromname = ecpyalloc(fromfile);
  	else {
  		fromname = ecpyalloc(directory);
  		fromname = ecatalloc(fromname, "/");
! 		fromname = ecatalloc(fromname, fromfile);
  	}
! 	if (tofile[0] == '/')
! 		toname = ecpyalloc(tofile);
  	else {
  		toname = ecpyalloc(directory);
  		toname = ecatalloc(toname, "/");
! 		toname = ecatalloc(toname, tofile);
  	}
  	/*
  	** We get to be careful here since
--- 628,653 ----
  }
  
  static void
! dolink(fromfield, tofield)
! const char * const	fromfield;
! const char * const	tofield;
  {
  	register char *	fromname;
  	register char *	toname;
  
! 	if (fromfield[0] == '/')
! 		fromname = ecpyalloc(fromfield);
  	else {
  		fromname = ecpyalloc(directory);
  		fromname = ecatalloc(fromname, "/");
! 		fromname = ecatalloc(fromname, fromfield);
  	}
! 	if (tofield[0] == '/')
! 		toname = ecpyalloc(tofield);
  	else {
  		toname = ecpyalloc(directory);
  		toname = ecatalloc(toname, "/");
! 		toname = ecatalloc(toname, tofield);
  	}
  	/*
  	** We get to be careful here since
***************
*** 666,672 ****
  		if (result != 0 &&
  			access(fromname, F_OK) == 0 &&
  			!itsdir(fromname)) {
! 				const char *s = tofile;
  				register char * symlinkcontents = NULL;
  
  				while ((s = strchr(s+1, '/')) != NULL)
--- 666,672 ----
  		if (result != 0 &&
  			access(fromname, F_OK) == 0 &&
  			!itsdir(fromname)) {
! 				const char *s = tofield;
  				register char * symlinkcontents = NULL;
  
  				while ((s = strchr(s+1, '/')) != NULL)



More information about the tz mailing list