# HG changeset patch # User Mikael Berthe # Date 1188032788 -7200 # Node ID c3107650d165140078c4b2e80c9adf94aa766cfa # Parent b6d3330442696a336da8b03db1338fbd1c79933f Allow longer lines in config file The maximum line length in the conf. file should be the same as in the UI. Reported by "ManMachine". diff -r b6d333044269 -r c3107650d165 mcabber/src/settings.c --- a/mcabber/src/settings.c Fri Aug 24 07:06:10 2007 +0200 +++ b/mcabber/src/settings.c Sat Aug 25 11:06:28 2007 +0200 @@ -28,6 +28,10 @@ #include "utils.h" #include "logprint.h" +// Maximum line length +// (probably best to use the same value as INPUTLINE_LENGTH) +#define CONFLINE_LENGTH 1024 + static GHashTable *option; static GHashTable *alias; static GHashTable *binding; @@ -128,9 +132,9 @@ scr_LogPrint(LPRINT_LOGNORM, "Reading %s", filename); } - buf = g_new(char, 512); + buf = g_new(char, CONFLINE_LENGTH+1); - while (fgets(buf+1, 511, fp) != NULL) { + while (fgets(buf+1, CONFLINE_LENGTH, fp) != NULL) { // The first char is reserved to add a '/', to make a command line line = buf+1; ln++;