patches/xscreensaver-10-i18n.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 18061 1ad14cf3c086
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     1
/*
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     2
 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     3
 *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     4
 * Permission is hereby granted, free of charge, to any person obtaining a
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     5
 * copy of this software and associated documentation files (the "Software"),
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     6
 * to deal in the Software without restriction, including without limitation
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     7
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     8
 * and/or sell copies of the Software, and to permit persons to whom the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     9
 * Software is furnished to do so, subject to the following conditions:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    10
 *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    11
 * The above copyright notice and this permission notice (including the next
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    12
 * paragraph) shall be included in all copies or substantial portions of the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    13
 * Software.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    14
 *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    18
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    20
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    21
 * DEALINGS IN THE SOFTWARE.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    22
 */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    23
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    24
Fixes for bugs that cause problems localizing xscreensaver:
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    25
6203951 xscreensaver-lock was not properly l10ned
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    26
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18039
diff changeset
    27
diff --git xscreensaver-5.11/driver/xscreensaver.c xscreensaver-5.11/driver/xscreensaver.c
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18039
diff changeset
    28
--- xscreensaver-5.11/driver/xscreensaver.c
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18039
diff changeset
    29
+++ xscreensaver-5.11/driver/xscreensaver.c
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    30
@@ -144,6 +144,9 @@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    31
 #include <ctype.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    32
 #include <X11/Xlib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    33
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    34
+#include <locale.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    35
+#include <libintl.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    36
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    37
 #include <X11/Xlibint.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    38
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    39
 #include <X11/Xatom.h>
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18039
diff changeset
    40
@@ -1465,6 +1468,15 @@ main (int argc, char **argv)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    41
   struct passwd *spasswd;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    42
   int i;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    43
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    44
+#ifdef ENABLE_NLS
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    45
+  if (!setlocale (LC_ALL, ""))
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    46
+    fprintf (stderr, "locale not supported by C library\n");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    47
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    48
+  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    49
+  textdomain (GETTEXT_PACKAGE);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    50
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    51
+#endif /* ENABLE_NLS */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    52
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    53
   memset(si, 0, sizeof(*si));
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    54
 
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18039
diff changeset
    55
 #ifdef HAVE_XSCREENSAVER_LOCK
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18039
diff changeset
    56