diff --git a/2005/mynx/README.md b/2005/mynx/README.md index f18aa72b4..662c9fc73 100644 --- a/2005/mynx/README.md +++ b/2005/mynx/README.md @@ -16,15 +16,30 @@ make ### To run: ```sh -./prog +./mynx http:// ``` +You can specify a port by appending to the domain `:port`. See notes below on +the issue of https. + ### Try: ```sh -./mynx http://www.ioccc.org/ +./mynx http://www.textfiles.com ``` + +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) pointed out that this +will not work for https initially for two reasons. First it scanned for http://. +Cody changed it to scan for both http:// and https:// but the problem is a +secure connection needs to be set up before http commands can be sent. One would +also have to specify a port in the URL. Fortunately or unfortunately many more +websites use https nowadays so this entry will not work as well as it used to. +If one were to try and connect to `http://www.ioccc.org` with this entry they'll +just get a 301 error. Perhaps someone can come up with a pipeline that will make +this work with the change made. Otherwise just enjoy it for what it was. + + ## Judges' comments This little mynx will give any Fiery Fox a run for its money. A nice complement diff --git a/2005/mynx/mynx.c b/2005/mynx/mynx.c index c0a95094b..b3d21e644 100644 --- a/2005/mynx/mynx.c +++ b/2005/mynx/mynx.c @@ -147,7 +147,7 @@ main(I V, c *v) struct sockaddr_in A; L = 0; B = 1; - Q !sscanf(t, "http://%255[^/]%n", h, &n) && !*h) { + Q (!sscanf(t, "http://%255[^/]%n", h, &n)&&!sscanf(t,"https://%255[^/]%n",h, &n) && !*h)) { Q !(f = fopen(t, "rb"))) k 1; goto e; diff --git a/bugs.md b/bugs.md index c49727fda..c3da92b3c 100644 --- a/bugs.md +++ b/bugs.md @@ -226,6 +226,16 @@ is true on both linux and macOS, with `k` being equal to 22. Should the entry use `perror()`? Perhaps not but we're not sure of its purpose so it can stay for now with this note. +### [2005/mynx](2005/mynx/mynx.c) ([README.md](2005/mynx/README.md)) + +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) notes that, though +probably obvious, this entry will not work with https. He changed the code to +scan for https too (it exited before) in case someone comes up with a clever +command line to make it work but the problem is a secure connection has to first +be set up in order to give http commands. This is not a bug but it's worth +pointing out as it won't work on as many websites as it used to including the +[IOCCC website](https://www.ioccc.org) itself. + ### [2019/endoh](2019/endoh/prog.c) ([README.md](2019/endoh/README.md))