add new config item - max_user_text - to allow for large config files
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 9 Nov 2006 00:33:46 +0000 (00:33 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 9 Nov 2006 00:33:46 +0000 (00:33 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@741 7f574dfc-610e-0410-a909-a81674777703

ChangeLog
src/conky.c
src/conky.h
syntax/vim/syntax/conkyrc.vim

index 9d48f15..6b0267d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,17 +1,23 @@
 # $Id$
 
-2006-11-07     pkovacs
+2006-11-08
+       * Added new config item 'max_user_text' with default 16384,
+       twice as large as previous hard-coded default of 8192 bytes.
+       Increase as needed to accomodate large config files with a
+       great deal of text.  This closes SF bug #1574523.
+
+2006-11-07
        * Changes to configure.ac for pkg-config on x11/xext/xdamage,
        with fallback to conventional checks.
        * Fixed segmentation fault on SUGUSR1 bug.
        * Commented out Imlib2 from configure.ac since it's only partially
        implemented.
 
-2006-11-04     pkovacs
+2006-11-04
        * Removed broken mldonkey and seti support.
        * Added Hellf[i]re's nano syntax coloring script to svn.
 
-2006-11-03     pkovacs
+2006-11-03
        * Removed support for Xmms, BMP and Infopipe from conky.  
        The Xmms and Bmp players are projects are dead and distros such 
        as Gentoo are slating them for removal.  
index ed44776..a95cd9a 100644 (file)
@@ -311,6 +311,9 @@ static int background_colour = 0;
 static int fixed_size = 0, fixed_pos = 0;
 #endif
 
+/* maximum size of config TEXT buffer, i.e. below TEXT line. */
+static unsigned int max_user_text = MAX_USER_TEXT_DEFAULT;
+
 static int minimum_width, minimum_height;
 static int maximum_width;
 
@@ -6579,6 +6582,12 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, b) == 0)
                CONF("uppercase") {
                        stuff_in_upper_case = string_to_bool(value);
                }
+               CONF("max_user_text") {
+                       if (value)
+                               max_user_text = atoi(value);
+                       else
+                               CONF_ERR;
+               }
                CONF("text") {
                        if (text != original_text)
                                free(text);
@@ -6598,7 +6607,7 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, b) == 0)
                                            + 1);
                                strcat(text, buf);
 
-                               if (strlen(text) > 1024 * 8)
+                               if (strlen(text) > max_user_text)
                                        break;
                        }
                        fclose(fp);
index 31e3268..b8625ba 100644 (file)
@@ -48,6 +48,9 @@
 #define TEXT_BUFFER_SIZE 1280
 #define P_MAX_SIZE ((TEXT_BUFFER_SIZE * 4) - 2) 
 
+/* maximum size of config TEXT buffer, i.e. below TEXT line. */
+#define MAX_USER_TEXT_DEFAULT 16384
+
 #include <sys/socket.h>
 
 #define ERR(s, varargs...) \
index e4fcc6c..1a00071 100644 (file)
@@ -31,6 +31,7 @@ syn keyword ConkyrcSetting
         \ gap_x
         \ gap_y
         \ mail_spool
+       \ max_user_text
         \ maximum_width
         \ minimum_size
         \ min_port_monitor_connections