Compare commits

..

No commits in common. "5835f5b8f7d848403879bdb01fd8ddeaad33c355" and "d67e01086c5e02146c321e7403d1c6384acbfd05" have entirely different histories.

19
ccc.c
View file

@ -173,7 +173,7 @@ int main(int argc, char **argv)
/* go back */
case BACKSPACE:
case ARROW_LEFT:
case 'h':
case 'h':;
/* get parent directory */
strcpy(p_cwd, cwd);
char *last_slash = strrchr(cwd, '/');
@ -1002,19 +1002,8 @@ void edit_file(void)
char command[length];
snprintf(command, length, "%s %s", editor, filename);
pid_t pid = fork();
if (pid == 0) {
/* Child process */
execlp(editor, editor, filename, NULL);
_exit(1); /* Exit if exec fails */
} else if (pid > 0) {
/* Parent process */
waitpid(pid, NULL, 0);
system(command);
list_files();
} else {
/* Fork failed */
wpprintw("fork failed: %s", strerror(errno));
}
}
}
@ -1253,6 +1242,10 @@ int read_key(void)
}
}
FILE *f = fopen("/home/night/a", "a");
fprintf(f, "c: %d\n", c);
fclose(f);
if (c == '\033') {
char seq[3];