commit 86294a09e56a395ff91a61d13b307d86ca404855 from: Omar Polo date: Tue Jan 16 18:09:13 2024 UTC actually implement cmd_home commit - 33133ab14226d1bcb74a4fc133bcdd8c0b7343bf commit + 86294a09e56a395ff91a61d13b307d86ca404855 blob - 2b3921dcb7e0a0d518aea6e5ce49d2fbf30418e2 blob + bd2d752329a0e9cc48def01631b34b2561c5d131 --- cmd.c +++ cmd.c @@ -1068,7 +1068,19 @@ cmd_write_buffer(struct buffer *buffer) void cmd_home(struct buffer *buffer) { - message("Not implemented yet!"); + char path[GEMINI_URL_LEN]; + char *tilde, *t; + + strlcpy(path, current_tab->iri.iri_path, sizeof(path)); + + if ((tilde = strchr(path, '~')) != NULL && + tilde[1] != '\0' && tilde[1] != '/') { + if ((t = strchr(tilde, '/')) != NULL) + *++t = '\0'; + load_url_in_tab(current_tab, path, current_tab->hist_cur->h, + LU_MODE_NOCACHE); + } else + cmd_root(buffer); } void