~ubuntu-branches/ubuntu/wily/scim/wily-proposed

« back to all changes in this revision

Viewing changes to debian/patches/40_scim_user_home_overrides.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Rolf Leggewie
  • Date: 2010-08-11 18:28:44 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100811182844-rnn95k63cwehtm75
Tags: 1.4.9-5
* debian/copyright: add my copyright
* debian/control: update to standard 3.9.1, no further changes necessary

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 40_scim_user_home_overrides.dpatch by Colin Watson <cjwatson@ubuntu.com>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: Allow home directory and user name detection to be overridden using
6
 
## DP: SCIM_HOME and SCIM_USER environment variables respectively.
7
 
 
8
 
@DPATCH@
9
 
diff -urNad scim-1.4.7~/src/scim_utility.cpp scim-1.4.7/src/scim_utility.cpp
10
 
--- scim-1.4.7~/src/scim_utility.cpp    2007-06-26 15:31:38.000000000 +0100
11
 
+++ scim-1.4.7/src/scim_utility.cpp     2008-07-26 11:28:49.000000000 +0100
12
 
@@ -547,6 +547,11 @@
13
 
 
14
 
     struct passwd *pw;
15
 
 
16
 
+    home_dir = getenv ("SCIM_HOME");
17
 
+    if (home_dir && *home_dir) {
18
 
+        return String (home_dir);
19
 
+    }
20
 
+
21
 
     setpwent ();
22
 
     pw = getpwuid (getuid ());
23
 
     endpwent ();
24
 
@@ -568,6 +573,11 @@
25
 
     struct passwd *pw;
26
 
     const char *user_name;
27
 
 
28
 
+    user_name = getenv ("SCIM_USER");
29
 
+    if (user_name && *user_name) {
30
 
+        return String (user_name);
31
 
+    }
32
 
+
33
 
     setpwent ();
34
 
     pw = getpwuid (getuid ());
35
 
     endpwent ();