commit 9a8a7402e6fe68618c8aaa33d2386964e10bd924 from: Omar Polo date: Sun Jul 18 08:02:59 2021 UTC move err pages to telescope.c commit - f04d2fc5d267fbe439306a1e4c759ae850ce0db1 commit + 9a8a7402e6fe68618c8aaa33d2386964e10bd924 blob - 4fbb7ad31452beaf72937646a2d981c2597607c9 blob + 1d8063e6a2ffd06e56f6ee378a984f7bbc1c3b7e --- pages.c +++ pages.c @@ -132,28 +132,3 @@ const char *about_new = "=> about:help Help\n" "=> about:about Internal Pages\n" ; - -/* XXX: keep in sync with telescope.c:/^normalize_code/ */ -const char *err_pages[70] = { - [CANNOT_FETCH] = "# Couldn't load the page\n", - [TOO_MUCH_REDIRECTS] = "# Too much redirects\n", - [MALFORMED_RESPONSE] = "# Got a malformed response\n", - [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n", - [UNKNOWN_PROTOCOL] = "# Unknown protocol\n", - - [10] = "# Input required\n", - [11] = "# Input required\n", - [40] = "# Temporary failure\n", - [41] = "# Server unavailable\n", - [42] = "# CGI error\n", - [43] = "# Proxy error\n", - [44] = "# Slow down\n", - [50] = "# Permanent failure\n", - [51] = "# Not found\n", - [52] = "# Gone\n", - [53] = "# Proxy request refused\n", - [59] = "# Bad request\n", - [60] = "# Client certificate required\n", - [61] = "# Certificate not authorised\n", - [62] = "# Certificate not valid\n" -}; blob - afae4746c7c58920c3d9d4b0b9727ab7494656fc blob + b6ea65930d862fa2044bc2dc882577f033db053a --- pages.h +++ pages.h @@ -22,11 +22,4 @@ extern const char *about_blank; extern const char *about_help; extern const char *about_new; -#define CANNOT_FETCH 0 -#define TOO_MUCH_REDIRECTS 1 -#define MALFORMED_RESPONSE 2 -#define UNKNOWN_TYPE_OR_CSET 3 -#define UNKNOWN_PROTOCOL 4 -extern const char *err_pages[70]; - #endif blob - 8dc28bf785912f6358c37733e25fec6f96b27fd7 blob + e0d1622701c72cc416db7cee61b3fa4878827d5b --- telescope.c +++ telescope.c @@ -42,6 +42,38 @@ static struct proto protos[] = { { NULL, NULL }, }; + +#define CANNOT_FETCH 0 +#define TOO_MUCH_REDIRECTS 1 +#define MALFORMED_RESPONSE 2 +#define UNKNOWN_TYPE_OR_CSET 3 +#define UNKNOWN_PROTOCOL 4 + +/* XXX: keep in sync with telescope.c:/^normalize_code/ */ +const char *err_pages[70] = { + [CANNOT_FETCH] = "# Couldn't load the page\n", + [TOO_MUCH_REDIRECTS] = "# Too much redirects\n", + [MALFORMED_RESPONSE] = "# Got a malformed response\n", + [UNKNOWN_TYPE_OR_CSET] = "# Unsupported type or charset\n", + [UNKNOWN_PROTOCOL] = "# Unknown protocol\n", + + [10] = "# Input required\n", + [11] = "# Input required\n", + [40] = "# Temporary failure\n", + [41] = "# Server unavailable\n", + [42] = "# CGI error\n", + [43] = "# Proxy error\n", + [44] = "# Slow down\n", + [50] = "# Permanent failure\n", + [51] = "# Not found\n", + [52] = "# Gone\n", + [53] = "# Proxy request refused\n", + [59] = "# Bad request\n", + [60] = "# Client certificate required\n", + [61] = "# Certificate not authorised\n", + [62] = "# Certificate not valid\n" +}; + static void die(void) __attribute__((__noreturn__)); static struct tab *tab_by_id(uint32_t); static void handle_imsg_err(struct imsg*, size_t); @@ -766,7 +798,8 @@ load_last_session(void) if ((session = fopen(session_file, "r")) == NULL) { /* first time? */ - current_tab = new_tab("about:help"); + new_tab("about:new"); + switch_to_tab(new_tab("about:help")); return; }