~ubuntu-branches/ubuntu/karmic/cyrus-imapd-2.2/karmic

« back to all changes in this revision

Viewing changes to debian/patches/21-fix_config-parsing.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-02-15 17:40:07 UTC
  • Revision ID: james.westby@ubuntu.com-20060215174007-tu5fx5wasxrw4596
Tags: 2.2.12-3ubuntu1
Build using Berkeley DB 4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 21-fix_config-parsing.dpatch by Sven Mueller <debian@incase.de>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Fix parsing of master.conf
 
6
 
 
7
@DPATCH@
 
8
diff -urNad complete.dpatch/master/masterconf.c /tmp/dpep.CfovCR/complete.dpatch/master/masterconf.c
 
9
--- complete.dpatch/master/masterconf.c 2005-11-11 15:25:37.000000000 +0100
 
10
+++ /tmp/dpep.CfovCR/complete.dpatch/master/masterconf.c        2005-11-11 15:27:02.084797577 +0100
 
11
@@ -150,8 +150,13 @@
 
12
     const char *val = masterconf_getstring(e, key, NULL);
 
13
 
 
14
     if (!val) return def;
 
15
-    if (!isdigit((int) *val) && 
 
16
-       (*val != '-' || !isdigit((int) val[1]))) return def;
 
17
+    if (!isdigit((int) *val) &&
 
18
+        (*val != '-' || !isdigit((int) val[1]))) {
 
19
+       syslog(LOG_DEBUG, "value '%s' for '%s' does not look like a number.",
 
20
+            val, key);
 
21
+      return def;
 
22
+    }
 
23
+
 
24
     return atoi(val);
 
25
 }
 
26
 
 
27
@@ -169,6 +174,10 @@
 
28
             (val[0] == 'o' && val[1] == 'n') || val[0] == 't') {
 
29
        return 1;
 
30
     }
 
31
+
 
32
+    syslog(LOG_DEBUG, "cannot interpret value '%s' for key '%s'. use y/n.",
 
33
+          val, key);
 
34
+
 
35
     return def;
 
36
 }
 
37