comparison mcabber/src/settings.c @ 1278:c3107650d165

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".
author Mikael Berthe <mikael@lilotux.net>
date Sat, 25 Aug 2007 11:06:28 +0200
parents 033576acac4c
children 3b338a5c01fc
comparison
equal deleted inserted replaced
1277:b6d333044269 1278:c3107650d165
26 #include "settings.h" 26 #include "settings.h"
27 #include "commands.h" 27 #include "commands.h"
28 #include "utils.h" 28 #include "utils.h"
29 #include "logprint.h" 29 #include "logprint.h"
30 30
31 // Maximum line length
32 // (probably best to use the same value as INPUTLINE_LENGTH)
33 #define CONFLINE_LENGTH 1024
34
31 static GHashTable *option; 35 static GHashTable *option;
32 static GHashTable *alias; 36 static GHashTable *alias;
33 static GHashTable *binding; 37 static GHashTable *binding;
34 38
35 #ifdef HAVE_GPGME /* PGP settings */ 39 #ifdef HAVE_GPGME /* PGP settings */
126 if (mainfile) 130 if (mainfile)
127 checkset_perm(filename, TRUE); 131 checkset_perm(filename, TRUE);
128 scr_LogPrint(LPRINT_LOGNORM, "Reading %s", filename); 132 scr_LogPrint(LPRINT_LOGNORM, "Reading %s", filename);
129 } 133 }
130 134
131 buf = g_new(char, 512); 135 buf = g_new(char, CONFLINE_LENGTH+1);
132 136
133 while (fgets(buf+1, 511, fp) != NULL) { 137 while (fgets(buf+1, CONFLINE_LENGTH, fp) != NULL) {
134 // The first char is reserved to add a '/', to make a command line 138 // The first char is reserved to add a '/', to make a command line
135 line = buf+1; 139 line = buf+1;
136 ln++; 140 ln++;
137 141
138 // Strip leading spaces 142 // Strip leading spaces