diff options
author | Marvin Borner | 2020-11-01 00:02:33 +0100 |
---|---|---|
committer | Marvin Borner | 2020-11-01 00:02:33 +0100 |
commit | e0d3b1671b3f94657d70223b51285ed287c882df (patch) | |
tree | 53bbe85c5504b869bc118a14eff468b647ae2d7b /apps/exec.c | |
parent | c35a83655707c9aae8f728eb850255ad0f115d11 (diff) |
New binary directory structure
Diffstat (limited to 'apps/exec.c')
-rw-r--r-- | apps/exec.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/exec.c b/apps/exec.c index 038d2ce..774362f 100644 --- a/apps/exec.c +++ b/apps/exec.c @@ -1,7 +1,11 @@ #include <gui.h> +#include <mem.h> #include <print.h> +#include <str.h> #include <sys.h> +#define PATH "/bin/" + #define HEIGHT 32 #define WIDTH 300 #define BORDER 2 @@ -10,7 +14,11 @@ void on_submit(struct gui_event_keyboard *event, struct element *elem) { (void)event; char *inp = ((struct element_text_input *)elem->data)->text; - exec(inp, inp, NULL); + u8 l = strlen(PATH) + strlen(inp) + 1; + char *final = malloc(l); + strcat(final, PATH); + strcat(final, inp); + exec(final, inp, NULL); } int main() @@ -22,7 +30,6 @@ int main() input->event.on_submit = on_submit; - gfx_redraw_focused(); // TODO: Remove once partial redrawing is finished gui_event_loop(root); return 0; |