diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-06-19 10:58:59 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-06-19 10:58:59 +0200 |
commit | 70b8ddeaae8864dfb3bea0477d3e70aa1f456644 (patch) | |
tree | 367fdbcd01de096a43f3373bc3db487f72a1c4f0 /sys | |
parent | e393b278069fcc2690832c5e6fcbf58c008837dc (diff) |
mothra: cleanup
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/cmd/mothra/forms.c | 14 | ||||
-rw-r--r-- | sys/src/cmd/mothra/libpanel/panel.h | 3 |
2 files changed, 7 insertions, 10 deletions
diff --git a/sys/src/cmd/mothra/forms.c b/sys/src/cmd/mothra/forms.c index b3bbc2e9b..615f2a813 100644 --- a/sys/src/cmd/mothra/forms.c +++ b/sys/src/cmd/mothra/forms.c @@ -1,6 +1,3 @@ -/* - * type=image is treated like submit - */ #include <u.h> #include <libc.h> #include <draw.h> @@ -463,17 +460,18 @@ void h_fileinput(Panel *p, int){ f = p->userp; nstrcpy(name, f->value, sizeof(name)); - free(f->value); - f->state=0; for(;;){ - if(eenter("Upload file", name, sizeof(name), &mouse) <= 0) + if(eenter("Upload file", name, sizeof(name), &mouse) <= 0){ + p->state = 0; break; + } if(access(name, AREAD) == 0){ - f->state=1; + free(f->value); + f->value = strdup(name); + p->state = 1; break; } } - f->value = strdup(name); pldraw(f->p, screen); } diff --git a/sys/src/cmd/mothra/libpanel/panel.h b/sys/src/cmd/mothra/libpanel/panel.h index becca3eb8..740bb5d45 100644 --- a/sys/src/cmd/mothra/libpanel/panel.h +++ b/sys/src/cmd/mothra/libpanel/panel.h @@ -57,8 +57,7 @@ struct Panel{ void (*free)(Panel *); /* free fields of data when done */ }; /* - * Panel flags -- there are more private flags in panelprivate.h - * that need to be kept synchronized with these! + * Panel flags */ #define PACK 0x0007 /* which side of the parent is the Panel attached to? */ #define PACKN 0x0000 |