<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "parser.h"
#include "interpreter.h"
#include "builtins.h"

void prompt()
{
	if (interactive_mode) {
		printf("%s", geteuid() == 0 ? "s# " : "s$ ");
		fflush(stdout);
	}
}

int main(int argc, char **argv, char **envp)
{
	struct AST* n;
	int i, b;
	FILE *f;

	int status;
	pid_t p;

	if (argc == 1) {
		f = stdin;

		interactive_mode = isatty(fileno(stdin));
	}
	else {
		f = fopen(argv[1], "r");
		if (!f) {
			fprintf(stderr, "Could not open file <%s>!", argv[1]);
			exit(-1);
		}

		interactive_mode = 0;
	}


	do {
		prompt();

		n = parse(f, &b, envp);

		if (n && !perform_builtin(n)) {
			if (!(p = fork())) {
				interpret(n, envp);
				puts("== SHOULD NEVER GET HERE ==");
				return -1;
			}

			if (!b) {
				waitpid(p, &status, 0);
			}
		}

		if (n)
			free_ast(n);

		skip_newline(f);<commit_msg>removed execution of commands from t6 for fuzzing purposes<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "parser.h"
#include "interpreter.h"
#include "builtins.h"

void prompt()
{
	if (interactive_mode) {
		printf("%s", geteuid() == 0 ? "s# " : "s$ ");
		fflush(stdout);
	}
}

int main(int argc, char **argv, char **envp)
{
	struct AST* n;
	int i, b;
	FILE *f;

	int status;
	pid_t p;

	if (argc == 1) {
		f = stdin;

		interactive_mode = isatty(fileno(stdin));
	}
	else {
		f = fopen(argv[1], "r");
		if (!f) {
			fprintf(stderr, "Could not open file <%s>!", argv[1]);
			exit(-1);
		}

		interactive_mode = 0;
	}


	do {
		prompt();

		n = parse(f, &b, envp);

		if (n)
			free_ast(n);

		skip_newline(f);
{'fraction_non_alphanumeric': 0.2011002444987775, 'fraction_numerical': 0.009168704156479218, 'mean_word_length': 3.1653944020356235, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5050115', 'n_tokens_mistral': 807, 'n_tokens_neox': 716, 'n_words': 175}