<commit_before>


#define exit_with_code(code) { result = code; goto _exit; }

int compile_files(
  YR_COMPILER* compiler,
  int argc,
  const char** argv)
{
  for (int i = 0; i < argc - 1; i++)
  {
    const char* ns;
    const char* file_name;
    char* colon = (char*) strchr(argv[i], ':');

    // Namespace delimiter must be a colon not followed by a slash or backslash
    if (colon && *(colon + 1) != '\\' && *(colon + 1) != '/')
    {
      file_name = colon + 1;
      *colon = '\0';
      ns = argv[i];
    }
    else
    {
      file_name = argv[i];
      ns = NULL;
    }

    FILE* rule_file = fopen(file_name, "r");

    if (rule_file == NULL)
    {
      fprintf(stderr, "error: could not open file: %s\n", file_name);
      fclose(rule_file);
      return 0;
    }

    yr_compiler_add_file(compiler, rule_file, ns, file_name);

    fclose(rule_file);
  }

  return 1;
}<commit_msg>Remove unnecessary call to fclose.<commit_after>


#define exit_with_code(code) { result = code; goto _exit; }

int compile_files(
  YR_COMPILER* compiler,
  int argc,
  const char** argv)
{
  for (int i = 0; i < argc - 1; i++)
  {
    const char* ns;
    const char* file_name;
    char* colon = (char*) strchr(argv[i], ':');

    // Namespace delimiter must be a colon not followed by a slash or backslash
    if (colon && *(colon + 1) != '\\' && *(colon + 1) != '/')
    {
      file_name = colon + 1;
      *colon = '\0';
      ns = argv[i];
    }
    else
    {
      file_name = argv[i];
      ns = NULL;
    }

    FILE* rule_file = fopen(file_name, "r");

    if (rule_file == NULL)
    {
      fprintf(stderr, "error: could not open file: %s\n", file_name);
      return 0;
    }

    yr_compiler_add_file(compiler, rule_file, ns, file_name);

    fclose(rule_file);
  }

  return 1;
}
{'fraction_non_alphanumeric': 0.15290178571428573, 'fraction_numerical': 0.008928571428571428, 'mean_word_length': 2.3639774859287055, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1473137', 'n_tokens_mistral': 687, 'n_tokens_neox': 651, 'n_words': 183}