~ubuntu-branches/ubuntu/karmic/uim/karmic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/03_fix-bug586-uim-crash.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2004-06-18 19:32:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040618193234-ljro97hmg52dsnt7
Tags: 1:0.3.9-1
* New upstream release
* debian/rules: Add --without-m17nlib in configure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
## 03_fix-bug586-uim-crash.dpatch by Masahito Omote <omote@debian.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
if [ $# -lt 1 ]; then
 
8
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
 
9
    exit 1
 
10
fi
 
11
 
 
12
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
 
13
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
 
14
 
 
15
case "$1" in
 
16
    -patch) patch -p1 ${patch_opts} < $0;;
 
17
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
 
18
    *)
 
19
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
 
20
        exit 1;;
 
21
esac
 
22
 
 
23
exit 0
 
24
 
 
25
@DPATCH@
 
26
diff -urNad /home/omote/debian/debian-official/japanese/pkg-ime/uim/uim/canna.c uim/uim/canna.c
 
27
--- /home/omote/debian/debian-official/japanese/pkg-ime/uim/uim/canna.c 2004-05-02 17:22:38.000000000 +0900
 
28
+++ uim/uim/canna.c     2004-05-02 18:00:26.000000000 +0900
 
29
@@ -474,16 +474,22 @@
 
30
 void
 
31
 uim_quit_canna(void)
 
32
 {
 
33
-  if(cannaserver != NULL)
 
34
+  if(cannaserver != NULL) {
 
35
      free(cannaserver);
 
36
+     cannaserver = NULL;
 
37
+  }
 
38
 
 
39
   if(api.RkFinalize)
 
40
      api.RkFinalize();
 
41
 
 
42
-  if(api.lib)
 
43
+  if(api.lib) {
 
44
      dlclose(api.lib);
 
45
+     memset(&api, 0, sizeof(struct canna_api));
 
46
+  }
 
47
 
 
48
-  if(context_array != NULL)
 
49
+  if(context_array != NULL) {
 
50
      free(context_array);
 
51
+     context_array = NULL;
 
52
+  }
 
53
 }
 
54
 #endif /* HAVE_CANNA_RK_H */
 
55
diff -urNad /home/omote/debian/debian-official/japanese/pkg-ime/uim/uim/uim.c uim/uim/uim.c
 
56
--- /home/omote/debian/debian-official/japanese/pkg-ime/uim/uim/uim.c   2004-05-02 17:22:43.000000000 +0900
 
57
+++ uim/uim/uim.c       2004-05-02 18:00:34.000000000 +0900
 
58
@@ -398,6 +398,8 @@
 
59
     pw = getpwuid(getuid());
 
60
     fn = malloc(strlen(pw->pw_dir)+10);
 
61
     sprintf(fn, "%s/.uim", pw->pw_dir);
 
62
+  } else {
 
63
+    fn = strdup(fn);
 
64
   }
 
65
 
 
66
   fp = fopen(fn, "r");
 
67
@@ -579,6 +581,11 @@
 
68
 uim_quit(void)
 
69
 {
 
70
   int i;
 
71
+
 
72
+  if (!uim_initialized) {
 
73
+    return;
 
74
+  }
 
75
+
 
76
   /* release still active contexts */
 
77
   for (i = 0; i < CONTEXT_ARRAY_SIZE; i++) {
 
78
     if (context_array[i]) {