arp242 / find-cursor

Highlight the cursor position in X11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Program name missing from error messages

maramon opened this issue · comments

If environment variable DISPLAY is not set, the following error message is printed:

(null): DISPLAY not set

As far as I can see, it is intended that program name should be printed instead of "(null)". The issue can be fixed by removing line

argv += optind;

I wonder what the purpose of the line is.

I wonder what the purpose of the line is.

It's intended for commands with positional arguments, like filename1 and filename2 in:

$ foo -c opt filename1 filename2

But that serves no purpose here, as there are no such parameters. I don't often program in C, and probably copy/pasted that from what I considered a reputable documentation or example. While I don't tend to blindly copy/paste I missed that this serves no purpose here.

At any rate, I fixed it now. Thanks for reporting!