diff options
| author | nasrlol <nsrddyn@gmail.com> | 2025-02-12 23:02:07 +0100 |
|---|---|---|
| committer | nasrlol <nsrddyn@gmail.com> | 2025-02-12 23:02:07 +0100 |
| commit | 3010301bd7d20cd14b1eda9bd24da172c3924c89 (patch) | |
| tree | 7fb33cd85ece474c2b6cc0bf8276bb8bbe3d1783 /gnu_history.c | |
| parent | 87fb4d9ea774bc7fd69076947925fac01e68f60b (diff) | |
working on the main function of the code trying to get the lines to correctly dislay everything, still having a little of trouble though
Diffstat (limited to 'gnu_history.c')
| -rw-r--r-- | gnu_history.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/gnu_history.c b/gnu_history.c deleted file mode 100644 index 9a9b794..0000000 --- a/gnu_history.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * ===================================================================================== - * - * Filename: gnu_history.c - * - * Description: testing GNU HISTORY AND GNU READLINE - * - * Version: 1.0 - * Created: 02/05/2025 19:31:12 - * Revision: none - * Compiler: gcc - * - * Author: YOUR NAME (), - * Organization: - * - * ===================================================================================== - */ -#include <stdio.h> -#include <readline/readline.h> -#include <readline/history.h> -#include <stdlib.h> - -int main() { - char *input; - - using_history(); // Initialize history - - while (1) { - input = readline("shell> "); // Read user input - - if (!input) break; // Handle Ctrl+D (EOF) - - if (*input) { // If input is not empty - add_history(input); // Save input to history - } - - printf("You typed: %s\n", input); - - free(input); // readline() allocates memory, so free it - } - - return 0; -} |
