Entering command :0
causes bombadillo to exit #20
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#20
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On any page, entering
:0
causes bombadillo to exit with no error messages and a return code of 0.This isn't documented as a way to quit the program and I would have expected a similar error to entering a bad command. Maybe you have another idea on this?
BTW: I did try
:-1
as well just in case it was a weird number thing, and it behaved appropriately and returned the message "dial tcp: lookup -1: Temporary failure in name resolution". Also,:000000000000001
goes to link 1, which is technically correct.Wow, that is a good bug find! My guess is that somewhere that is getting evaluated as false rather than 0. I'll have to do some digging. I had never noticed that, but it is real weird.
Thanks for the issue submission!
I solved the problem. I was not doing a check for the link number being greater than zero. Since the link number represents a array/slice position and it gets a -1 applied to it, a zero would make it try to access the -1 array element... which throws a panic and exits the program. I had not expected a user to enter a negative number, so that was treated as a string, which sent it to go to url instead of go to link and just came back as a bad url.
So, given the above, I have added the ability to detect a negative number as well as a decimal (+ or -) and handle that as part of
goToLink
(a decimal or a negative just throws a regular error that is reported as an invalid link ID).I probably should have had the parser detect these sorts of numbers rather than deal with it in the main package, but it will suffice for now and I'd rather not modify the parser much at this point.
I'll have a PR in shortly for this fix.
Closed by #22
This issue has been resolved. Now, rather than crashing, the program returns proper error messaging.