<commit_before>#include "system.h"
#include "sccs.h" 

extern char *bin;

int
main(int ac,  char **av)
{
	char buf[MAXLINE];

	platformInit();  
	while (fgets(buf, sizeof(buf), stdin)) {
		if (strneq(buf, "# Patch vers:", 13)) {
			fputs(buf, stdout);
			while (fgets(buf, sizeof(buf), stdin)) {
				fputs(buf, stdout);
			}
			return (0);
		} else if (strneq(buf, "## Wrapped with", 15)) {
			char wrap_path[MAXLINE], wrap[MAXPATH];

			unless (sscanf(&buf[16], "%s ##", wrap) == 1) {
				fprintf(stderr,  "can not extract wrapper\n");
				exit(1);
			}
			sprintf(wrap_path, "%sun%swrap", bin, wrap);
			if (executable(wrap_path)) {
				char *av[2] = {wrap_path, 0};
				return (spawnvp_ex(_P_WAIT, wrap_path, av));
			} else {
				FILE *f = fopen(DEV_TTY, "wb");
				fprintf(f,
				   "bk receive: don't have %s wrapper\n", wrap);
				fclose(f);
				return(1);
			}
		} 
	}
	/* we should never get here */
	return (1);
}<commit_msg>unwrap.c	Andrew's fix for I/O.<commit_after>#include "system.h"
#include "sccs.h" 

extern char *bin;

int
main(int ac,  char **av)
{
	char buf[MAXLINE];

	platformInit();  
	while (getline(0, buf, sizeof(buf)) > 0) {
		if (strneq(buf, "# Patch vers:", 13)) {
			fprintf(stdout, "%s\n", buf);
			while (getline(0, buf, sizeof(buf)) > 0) {
				fprintf(stdout, "%s\n", buf);
			}
			return (0);
		} else if (strneq(buf, "## Wrapped with", 15)) {
			char wrap_path[MAXLINE], wrap[MAXPATH];

			unless (sscanf(&buf[16], "%s ##", wrap) == 1) {
				fprintf(stderr,  "can not extract wrapper\n");
				exit(1);
			}
			sprintf(wrap_path, "%sun%swrap", bin, wrap);
			if (executable(wrap_path)) {
				char *av[2] = {wrap_path, 0};
				return (spawnvp_ex(_P_WAIT, wrap_path, av));
			} else {
				FILE *f = fopen(DEV_TTY, "wb");
				fprintf(f,
				   "bk receive: don't have %s wrapper\n", wrap);
				fclose(f);
				return(1);
			}
		} 
	}
	/* we should never get here */
	return (1);
}
{'fraction_non_alphanumeric': 0.1967556253270539, 'fraction_numerical': 0.015698587127158554, 'mean_word_length': 3.2488888888888887, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4387387', 'n_tokens_mistral': 915, 'n_tokens_neox': 774, 'n_words': 188}