cgo

[Fork] Gopher Client
git clone https://git.jojolepro.com/cgo.git
Log | Files | Refs | README | LICENSE

commit be1eb37a7fdb2317458cf9d9292b52ef17cb8740
parent 08374e3c6caf5d00c6c4a6d0d22d9ec4dea95788
Author: Sebastian Steinhauer <s.steinhauer@yahoo.de>
Date:   Thu, 16 Oct 2014 17:25:01 +0200

Revert "added 'u' to go upwards in selector" - it is broken

This reverts commit f8aa83e832045fea7a90e8bb43966b6dfab7b738.

Diffstat:
MREADME.md | 1-
Mcgo.c | 23-----------------------
2 files changed, 0 insertions(+), 24 deletions(-)

diff --git a/README.md b/README.md @@ -65,7 +65,6 @@ Usage * .[xx] download selector * h show history * h[xx] jump to specifiy history item - * u go up to parent selector * g[URI] jumps right to the specified gopher URI [xx] stands for the two colored letters in front of selectors. diff --git a/cgo.c b/cgo.c @@ -559,25 +559,6 @@ int parse_uri(const char *uri) return 1; } -void view_parent_directory() -{ - int i, last; - - /* copy current */ - snprintf(parsed_host, sizeof(parsed_host), "%s", current_host); - snprintf(parsed_port, sizeof(parsed_port), "%s", current_port); - snprintf(parsed_selector, sizeof(parsed_selector), "%s", current_selector); - /* find last / */ - for (i = 0, last = -1; parsed_selector[i]; i++) - if (parsed_selector[i] == '/') - last = i; - if (last >= 0) { - if (last == 0) last++; /* keep last / */ - parsed_selector[last] = 0; - view_directory(parsed_host, parsed_port, parsed_selector, 1); - } else puts("(already at top level)"); -} - int main(int argc, char *argv[]) { int i; @@ -643,7 +624,6 @@ int main(int argc, char *argv[]) ".LINK - download the given link\n" "h - show history\n" "hLINK - jump to the specified history item\n" - "u - go up to parent selector\n" "gURI - jump to the given gopher URI\n" "C^d - quit"); break; @@ -660,9 +640,6 @@ int main(int argc, char *argv[]) case 'h': view_history(make_key(line[1], line[2])); break; - case 'u': - view_parent_directory(); - break; case 'g': if (parse_uri(&line[1])) view_directory(parsed_host, parsed_port, parsed_selector, 1); else puts("invalid gopher URI");