~ubuntu-branches/ubuntu/precise/xbuffy/precise

« back to all changes in this revision

Viewing changes to debian/patches/xbuffyrc.patch

  • Committer: Bazaar Package Importer
  • Author(s): Bernhard R. Link
  • Date: 2010-01-01 18:12:56 UTC
  • Revision ID: james.westby@ubuntu.com-20100101181256-eokwvua5v1u4azuz
Tags: 3.3.bl.3.dfsg-8
* Import package into git, generate debian/patches from git
* Use -z defs instead of -z syms so binutils-gold is happy
* fix spelling error in manpage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Author: Bernhard R. Link <brlink@debian.org>
2
 
Description: Use $HOME/.xbuffyrc if nothing else is given.
3
 
 
4
 
Index: xbuffy-3.3.bl.3/boxfile.c
5
 
===================================================================
6
 
--- xbuffy-3.3.bl.3.orig/boxfile.c      2006-03-31 18:27:54.000000000 +0200
7
 
+++ xbuffy-3.3.bl.3/boxfile.c   2006-03-31 18:28:00.000000000 +0200
8
 
@@ -16,6 +16,7 @@
9
 
 *******************************************************************************/
10
 
 
11
 
 
12
 
+#include <errno.h>
13
 
 #include <stdio.h>
14
 
 #include <stdlib.h>
15
 
 #include <ctype.h>
16
 
@@ -256,7 +257,8 @@
17
 
 
18
 
        if ((boxes = fopen(boxFile, "r")) == 0)
19
 
        {
20
 
-               fprintf(stderr, "Could not open boxfile %s\n", boxFile);
21
 
+               if( boxFile == data.boxFile || errno != ENOENT )
22
 
+                       fprintf(stderr, "Could not open boxfile %s\n", boxFile);
23
 
                return;
24
 
        }
25
 
 
26
 
Index: xbuffy-3.3.bl.3/xbuffy.c
27
 
===================================================================
28
 
--- xbuffy-3.3.bl.3.orig/xbuffy.c       2006-03-31 18:27:57.000000000 +0200
29
 
+++ xbuffy-3.3.bl.3/xbuffy.c    2006-03-31 18:28:00.000000000 +0200
30
 
@@ -1519,6 +1519,15 @@
31
 
         readBoxfile(data.boxFile);
32
 
     }
33
 
 
34
 
+    if ((data.boxFile == 0) && (nBoxes == 0))
35
 
+    {
36
 
+        const char *homedir = getenv("HOME");
37
 
+        char buffer[MAX_STRING];
38
 
+       if (homedir != NULL)
39
 
+            snprintf(buffer,MAX_STRING,"%s/.xbuffyrc",homedir);
40
 
+
41
 
+        readBoxfile(buffer);
42
 
+    }
43
 
 
44
 
     if (nBoxes == 0)
45
 
     {
46
 
Index: xbuffy-3.3.bl.3/xbuffy.man
47
 
===================================================================
48
 
--- xbuffy-3.3.bl.3.orig/xbuffy.man     2006-03-31 18:27:54.000000000 +0200
49
 
+++ xbuffy-3.3.bl.3/xbuffy.man  2006-03-31 18:28:00.000000000 +0200
50
 
@@ -109,6 +109,9 @@
51
 
 .TP
52
 
 .B X Options
53
 
 Standard X windows options (e.g. \-fn, \-display, etc.)
54
 
+.SH FILES
55
 
+If nothing to look at is given at the command line, it will
56
 
+try to open $HOME/.xbuffyrc
57
 
 .SH ENVIRONMENT
58
 
 The names and purpose of the some of the following environment 
59
 
 variables were borrowed from Bash, the GNU Shell.
60
 
@@ -118,10 +121,12 @@
61
 
 polling for mail.
62
 
 .TP
63
 
 .B MAILPATH
64
 
-This is a colon separated list of files to check for mail.
65
 
+This is a colon separated list of files to check for mail,
66
 
+if nothing to look at was given and no $HOME/.xbuffyrc exists.
67
 
 .TP
68
 
 .B NEWSPATH
69
 
-This is a colon separated list of newsgroups to monitor.
70
 
+This is a colon separated list of newsgroups to monitor,
71
 
+if nothing to look at was given and no $HOME/.xbuffyrc exists.
72
 
 .TP
73
 
 .B NNTPSERVER
74
 
 This is the name of the NNTP server to use for news boxes.
75
 
@@ -145,7 +150,8 @@
76
 
 
77
 
 The following are settable on a per box basis by using
78
 
 the \fIboxfile\fR option (note that the boxfile may also be set in
79
 
-the Xresources with the resource Xbuffy.boxfile: <filename>).  
80
 
+the Xresources with the resource Xbuffy.boxfile: <filename> and
81
 
+if nothing it given at the command line, it tries to read $HOME/.xbuffyrc).
82
 
 
83
 
 When using a \fIboxfile\fR, only the \fIbox\fR line is required.  All options
84
 
 that are not given in the boxfile will default to the command line