@@ 41,6 41,7 @@ struct Hist
int request(Url *u);
void gemini_get(Url *u);
+void gemini_put(Response *r);
void texthit(Panel *p, int b, Rtext *t);
void message(char *s, ...);
@@ 75,13 76,14 @@ char *menu3[] = {
char*
-replace_char(char* str, char find, char replace){
- char *current_pos = strchr(str,find);
- while(current_pos){
- *current_pos = replace;
- current_pos = strchr(current_pos,find);
- }
- return str;
+replace_char(char* str, char find, char replace)
+{
+ char *current_pos = strchr(str,find);
+ while(current_pos){
+ *current_pos = replace;
+ current_pos = strchr(current_pos,find);
+ }
+ return str;
}
char*
@@ 389,7 391,7 @@ gemini_get(Url *url)
switch(r->status){
case 10:
- message("Input! %s", r->meta);
+ gemini_put(r);
break;
case 11:
message("Sensitive input! %s", r->meta);
@@ 478,6 480,22 @@ gemini_get(Url *url)
}
void
+gemini_put(Response *r)
+{
+ char buf[1024];
+ char *url;
+ strncpy(buf, "", sizeof(buf)-1);
+ if(eenter(r->meta, buf, sizeof(buf), mouse) <= 0){
+ message("Castor9");
+ return;
+ }
+
+ url = smprint("%s?%s", r->url->raw, buf);
+ message("Castor9");
+ gemini_get(urlparse(nil, url));
+}
+
+void
search(void)
{
static char last[256];