From http://www.jwz.org/xscreensaver/xscreensaver-5.21.tar.gz
[xscreensaver] / driver / test-passwd.c
index fe0dedb3b52013628f027809cafd0414f9022e2c..66cd3d4e0d9d4f64b6cd3f172e0082fde7bd4a86 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1998-2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2013 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -27,6 +27,7 @@
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
 #include <X11/Shell.h>
+#include <X11/Xlocale.h>
 
 #include "xscreensaver.h"
 #include "resources.h"
@@ -41,7 +42,7 @@ saver_info *global_si_kludge;
 
 FILE *real_stderr, *real_stdout;
 
-void monitor_power_on (saver_info *si) {}
+void monitor_power_on (saver_info *si, Bool on_p) {}
 Bool monitor_powered_on_p (saver_info *si) { return True; }
 void initialize_screensaver_window (saver_info *si) {}
 void raise_window (saver_info *si, Bool i, Bool b, Bool d) {}
@@ -63,6 +64,7 @@ void shutdown_stderr (saver_info *si) { }
 void resize_screensaver_window (saver_info *si) { }
 void describe_monitor_layout (saver_info *si) { }
 Bool update_screen_layout (saver_info *si) { return 0; }
+Bool in_signal_handler_p = 0;
 
 const char *blurb(void) { return progname; }
 Atom XA_SCREENSAVER, XA_DEMO, XA_PREFS;
@@ -135,6 +137,8 @@ static char *fallback[] = {
  0
 };
 
+extern Bool debug_passwd_window_p;  /* lock.c kludge */
+
 int
 main (int argc, char **argv)
 {
@@ -159,6 +163,7 @@ main (int argc, char **argv)
 
   si->version = (char *) malloc (5);
   memcpy (si->version, screensaver_id + 17, 4);
+  si->version[4] = 0;
   progname = argv[0];
   {
     char *s = strrchr(progname, '/');
@@ -199,6 +204,11 @@ main (int argc, char **argv)
 
   progclass = "XScreenSaver";
 
+  if (!setlocale (LC_CTYPE, ""))
+    fprintf (stderr, "%s: warning: could not set default locale\n",
+             progname);
+
+
   if (which != TTY)
     {
       toplevel_shell = XtAppInitialize (&si->app, progclass, 0, 0,
@@ -243,6 +253,7 @@ main (int argc, char **argv)
          si->unlock_cb = gui_auth_conv;
           si->auth_finished_cb = auth_finished_cb;
 
+          debug_passwd_window_p = True;
          xss_authenticate(si, True);
 
           if (si->unlock_state == ul_success)