FreeBSD/contrib/binutils/ld/ldmain.c
/* If directory DIR contains an "ldscripts" subdirectory,
   add DIR to the library search path and return TRUE,
   else return FALSE.  */
If directory DIR contains an "ldscripts" subdirectory,
add DIR to the library search path and return TRUE,
else return FALSE.
If directory DIR contains an " ldscripts " subdirectory add DIR to the library search path and return TRUE else return FALSE .
static bfd_boolean
check_for_scripts_dir (char *dir)
{
  size_t dirlen;
  char *buf;
  struct stat s;
  bfd_boolean res;
  dirlen = strlen (dir);
  buf = xmalloc (dirlen + sizeof ("/ldscripts"));
  sprintf (buf, "%s/ldscripts", dir);
  res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode);
  free (buf);
  if (res)
    ldfile_add_library_path (dir, FALSE);
  return res;
}
static bfd_boolean check_for_scripts_dir ( char * dir ) { size_t dirlen ; char * buf ; struct stat s ; bfd_boolean res ; dirlen = strlen ( dir ) ; buf = xmalloc ( dirlen + sizeof ( " " ) ) ; sprintf ( buf , " " , dir ) ; res = stat ( buf , & s ) == 0 && S_ISDIR ( s . st_mode ) ; free ( buf ) ; if ( res ) ldfile_add_library_path ( dir , FALSE ) ; return res ; }
If directory DIR contains an "ldscripts" subdirectory,
add DIR to the library search path and return TRUE,
else return FALSE.
If directory DIR contains an " ldscripts " subdirectory add DIR to the library search path and return TRUE else return FALSE .
/* sizeof counts the terminating NUL.  */