[comp.windows.x] Xlock bug and fix

engelson-sean@CS.YALE.EDU (Sean Philip Engelson) (09/21/89)

The new version of xlock has a bug in that it won't lock a screen if
the display given isn't of the form unix:N.n or localhost:N.n, but if
you're display is <machinename>:N.n, it refuses, even though it should
go ahead.  A simple fix is to use gethostname, here's a diff for
xlock.c:

----------------------------------------------------------------------
592a593
> 	char        hostname[30];
593a595
> 	gethostname(hostname,30);
599c601,602
< 		    && strncmp(display, "localhost", n))
---
> 		&& strncmp(display, "localhost", n)
> 		&& strncmp(display, hostname, n))
----------------------------------------------------------------------

Enjoy!

----------------------------------------------------------------------
Sean Philip Engelson, Poet Errant	Make your learning a fixture;
Yale Department of Computer Science	Say little and do much;
Box 2158 Yale Station			And receive everyone with 
New Haven, CT 06520			   a kindly attitude.
----------------------------------------------------------------------
	Esperanto: la metodo por krei paca mondo.
----------------------------------------------------------------------
	I see the eigenvalue in thine eye,
	I hear the tender tensor in thy sigh.
	Bernoulli would have been content to die
	Had he but known such a^2 cos 2(phi)!
			--Stanislaw Lem, "Cyberiad"