ref: bda1c8b8f19621ffb296af61e78adeac8e4a8b6a
parent: 70b8ddeaae8864dfb3bea0477d3e70aa1f456644
author: cinap_lenrek <[email protected]>
date: Tue Jun 19 07:03:09 EDT 2012
mothra: fix mistake
--- a/sys/src/cmd/mothra/forms.c
+++ b/sys/src/cmd/mothra/forms.c
@@ -461,17 +461,14 @@
f = p->userp;
nstrcpy(name, f->value, sizeof(name));
for(;;){
- if(eenter("Upload file", name, sizeof(name), &mouse) <= 0){
- p->state = 0;
+ if(eenter("Upload file", name, sizeof(name), &mouse) <= 0)
break;
- }
- if(access(name, AREAD) == 0){
- free(f->value);
- f->value = strdup(name);
- p->state = 1;
+ if(access(name, AREAD) == 0)
break;
- }
}
+ free(f->value);
+ f->value = strdup(name);
+ p->state = name[0] != 0;
pldraw(f->p, screen);
}