rem: get_link_name (path, &files[files_index]); linkpath = make_link_path (path, files[files_index].linkname);
add: get_link_name (path, f, command_line_arg); linkpath = make_link_path (path, f->linkname);
context: gobble_file (const char *name, enum filetype type, int explicit_arg,	     const char *dirname){  register uintmax_t blocks;  register char *path;  if (files_index == nfiles)    {      nfiles *= 2;      files = XREALLOC (files, struct fileinfo, nfiles);    }  files[files_index].linkname = 0;  files[files_index].linkmode = 0;  files[files_index].linkok = 0;  if (explicit_arg      || format_needs_stat      || (format_needs_type	  && (type == unknown	      /* FIXME: remove this disjunct.		 I don't think we care about symlinks here, but for now		 this won't make a big performance difference.  */	      || type == symbolic_link	      /* --indicator-style=classify (aka -F)		 requires that we stat each regular file		 to see if it's executable.  */	      || (type == normal && (indicator_style == classify				     /* This is so that --color ends up					highlighting files with the executable					bit set even when options like -F are					not specified.  */				     || print_with_color)))))    {      /* `path' is the absolute pathname of this file. */      int err;      if (name[0] == '/' || dirname[0] == 0)	path = (char *) name;      else	{	  path = (char *) alloca (strlen (name) + strlen (dirname) + 2);	  attach (path, dirname, name);	}      switch (dereference)	{	case DEREF_ALWAYS:	  err = stat (path, &files[files_index].stat);	  break;	case DEREF_COMMAND_LINE_ARGUMENTS:	case DEREF_COMMAND_LINE_SYMLINK_TO_DIR:	  if (explicit_arg)	    {	      int need_lstat;	      err = stat (path, &files[files_index].stat);	      if (dereference == DEREF_COMMAND_LINE_ARGUMENTS)		break;	      need_lstat = (err < 0			    ? errno == ENOENT			    : ! S_ISDIR (files[files_index].stat.st_mode));	      if (!need_lstat)		break;	      /* stat failed because of ENOENT, maybe indicating a dangling		 symlink.  Or stat succeeded, PATH does not refer to a		 directory, and --dereference-command-line-symlink-to-dir is		 in effect.  Fall through so that we call lstat instead.  */	    }	default: /* DEREF_NEVER */	  err = lstat (path, &files[files_index].stat);	  break;	}      if (err < 0)	{	  error (0, errno, "%s", quotearg_colon (path));	  exit_status = 1;	  return 0;	}#if HAVE_ACL      if (format == long_format)	{	  int n = file_has_acl (path, &files[files_index].stat);	  files[files_index].have_acl = (0 < n);	  if (n < 0)	    error (0, errno, "%s", quotearg_colon (path));	}#endif      if (S_ISLNK (files[files_index].stat.st_mode)	  && (format == long_format || check_symlink_color))	{	  char *linkpath;	  struct stat linkstats;	  get_link_name (path, &files[files_index]);	  linkpath = make_link_path (path, files[files_index].linkname);	  /* Avoid following symbolic links when possible, ie, when	     they won't be traced and when no indicator is needed. */	  if (linkpath	      && (indicator_style != none || check_symlink_color)	      && stat (linkpath, &linkstats) == 0)	    {	      files[files_index].linkok = 1;	      /* Symbolic links to directories that are mentioned on the	         command line are automatically traced if not being	         listed as files.  */	      if (!explicit_arg || format == long_format		  || !S_ISDIR (linkstats.st_mode))		{		  /* Get the linked-to file's mode for the filetype indicator		     in long listings.  */		  files[files_index].linkmode = linkstats.st_mode;		  files[files_index].linkok = 1;		}	    }	  if (linkpath)	    free (linkpath);	}      if (S_ISLNK (files[files_index].stat.st_mode))	files[files_index].filetype = symbolic_link;      else if (S_ISDIR (files[files_index].stat.st_mode))	{	  if (explicit_arg && !immediate_dirs)	    files[files_index].filetype = arg_directory;	  else	    files[files_index].filetype = directory;	}      else	files[files_index].filetype = normal;      blocks = ST_NBLOCKS (files[files_index].stat);      {	char buf[LONGEST_HUMAN_READABLE + 1];	int len = strlen (human_readable (blocks, buf, human_output_opts,					  ST_NBLOCKSIZE, output_block_size));	if (block_size_size < len)	  block_size_size = len < 7 ? len : 7;      }    }  else    {      files[files_index].filetype = type;#if HAVE_STRUCT_DIRENT_D_TYPE      files[files_index].stat.st_mode = DTTOIF (type);#endif      blocks = 0;    }  files[files_index].name = xstrdup (name);  files_index++;  return blocks;}