Example #1
0
string
kpse_readable_file P1C(const_string, name)
{
  string ret;

#ifdef WIN32
  unsigned int st = 0;
#else /* ! WIN32 */
  struct stat st;
#endif

  kpse_normalize_path((string)name);
  if (READABLE (name, st)) {
      ret = (string) name;
#ifdef ENAMETOOLONG
  } else if (errno == ENAMETOOLONG) {
      ret = kpse_truncate_filename (name);

      /* Perhaps some other error will occur with the truncated name, so
         let's call access again.  */
      if (!READABLE (ret, st)) { /* Failed.  */
          if (ret != name) free (ret);
          ret = NULL;
      }
#endif /* ENAMETOOLONG */
  } else { /* Some other error.  */
      if (errno == EACCES) { /* Maybe warn them if permissions are bad.  */
          if (!kpse_tex_hush ("readable")) {
              perror (name);
          }
      }
      ret = NULL;
  }
  return ret;
}
Example #2
0
void CheckChecksum(uint32_t c1, uint32_t c2, const char* name)
{
  /* Report a warning if both checksums are nonzero, they don't match,
     and the user hasn't turned it off.  */
  if (c1 && c2 && c1 != c2
#ifdef HAVE_LIBKPATHSEA
      && !kpse_tex_hush ("checksum")
#endif
      ) {
     Warning ("checksum mismatch in %s", name) ;
   }
}