summaryrefslogtreecommitdiff
path: root/src/lib-config
AgeCommit message (Collapse)Author
2018-04-08Make config_write more atomic to prevent truncation when out of spacedequis
This is modeled after glib's g_file_set_contents. It doesn't use that function directly because the writing is done with GIOChannel streaming-like writes and g_file_set_contents expects the whole thing to be in-memory. Main differences with g_file_set_contents: - complete lack of win32 special casing (cygwin/WSL should work though) - no fallocate() (linux only, but we don't know the size upfront, anyway) - always calls fsync (glib skips it on btrfs or when not overwriting) Other than that, it's the same old mkstemp + fsync + rename.
2016-11-29Enforce the is_node_list contract in lib-config setters.LemonBoy
An assertion failure is better than a segfault.
2015-04-20Change g_hash_table_contains() for compatibility with glib < 2.32Peder Stray
2015-04-17Merge pull request #199 from ailin-nemui/config-parserAlexander Færøy
Make config parser more robust
2015-04-07Change all strcmp() to g_strcmp0() to handle nulls gracefullydequis
Just a string replacement (but i did check every one of them) sed -i 's/strcmp(/g_strcmp0(/g' **/*.c
2015-02-17Make the config parser more robustAilin Nemui
We add some additional checks into the config parser's node_section_index, node_traverse and node_set_str functions. In particular, we check if the requested node is of scalar or complex type and whether this matches the value found in the config. If it does not match, then a warning is issued appropriately and the config is corrected.
2015-02-17Warn the user instead of crashing on wrong configAilin Nemui
The change introduced in #191 will crash irssi immediately if you accidentally try to /reload certain broken config files. It is enough to warn the user in this case, so we turn g_error into g_critical.
2015-02-17add CONFIG_REC to config_node_section* APIsAilin Nemui
this adds the CONFIG_REC * to the config_node_section and config_node_section_index APIs as they will require access to the config cache later on to make the config parser more robust.
2014-12-16Die if the wrong type of node is found when traversing configDavid Leadbeater
Fixes issue #187. It's a bit annoying this can't do anything other than exit, however as there's no schema for the config it's only possible to validate on use. This level of config can't be accessed from Perl so a script can't cause Irssi to die (via this method at least).
2014-06-27s/INCLUDES/AM_CPPFLAGS/gDave Reisner
Silences warnings on recent automake such as: src/core/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2014-06-10Replace deprecated g_str[n]casecmp with g_ascii_str[n]cmp.David Hill
2009-10-23Add forgotten g_io_channel_set_close_on_unref call to close the config file fdEmanuele Giaquinta
after saving, patch by Sven Wegener. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5101 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-08Code Cleanup:Alexander Færøy
Use g_string_append_printf() instead of g_string_sprintfa() (which is considered deprecated.) git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5003 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-16Use an io channel to write the config file.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4990 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-14Remove unused and odd function.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4985 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-14Fix typos.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4984 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-12Simplify, use 'o' printf conversion specifier to print number in octal.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4904 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-11Move lib-config typedefs in iconfig.h.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4759 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-11Document config_node_set_str.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4757 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-11Fix typos.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4756 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-11Keep documentation for public api only in headers to avoid duplication.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4755 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-01-21Remove .cvsignore files.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4672 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Oops. Update address correctly now.Wouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Update FSF addressWouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4489 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-01-11Allow identifiers to start with a digit, bug #177.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4409 dbcabf3a-b0e7-0310-adc4-f8d773084564
2004-05-10noinst_HEADERS -> pkginc_HEADERSTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3250 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-10-25config_node_nth() and config_node_index() don't count comments in configTimo Sirainen
anymore. fixes problems having comments in channels and servers block. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2971 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-05-17removed useless functionsTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2804 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-02-15renamed old config_node_index() to config_node_nth(). added newTimo Sirainen
config_node_index() function. added config_node_section_index() for adding/moving node to specified position in list. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2460 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-27toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in someTimo Sirainen
systems, use our own is_...() functions now instead. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-11-19Removed memory debugging code. It's a lot easier to check for bufferTimo Sirainen
overflows with electric fence and memory leaks with memprof. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2095 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-11-05Moved $(GLIB_CFLAGS) after -I includes, to make sure our own .h files get ↵Timo Sirainen
before possibly identically named headers in the glib's include directory. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1975 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-09-22added config_node_first() function to get the first non-comment node.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1812 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-09-22config_node_next() - Returns the next non-comment node in list. Use thisTimo Sirainen
function when reading blocks/lists in config file. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1811 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-05-11config_node_remove() - NULL parent is treated as root nodeTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-02-06'=' isn't really necessary, warn if it's missing but don't fail withoutTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1185 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-07Don't write indent spaces to empty linesTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1085 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-01Added/moved several "typedef struct _XXX XXX;" to common.h so thatTimo Sirainen
they're known to all files and I don't need those stupid "void *xxx" anymore just to avoid useless #include. Header files themselves don't either include others as often anymore. Added channel->ownnick to point to our NICK_REC in channel's nicks. Gives a minor speedup in few places :) Moved completion specific lastmsgs from channel/server core records to fe-common/core specific records. Also changed the nick completion logic a bit so it should work better now. Removed completion_keep_publics_count setting, but changed the meaning of completion_keep_publics to same as _count was before. Nick completion doesn't have any time specific code anymore. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1034 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-12-16Config file handle wasn't closed if config_write_block() failedTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@993 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-12-02config_close() didn't work correctly when config was parsed from stringTimo Sirainen
instead of file. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@909 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-26config changes, CONFIG_REC is now required parameter forTimo Sirainen
config_node_set_int/bool() and config_node_add_list() git-svn-id: http://svn.irssi.org/repos/irssi/trunk@886 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-26some updates for checking when to not autosave config.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@872 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-26Added modify counter which is increased every time something is changedTimo Sirainen
in configuration. Autosaving settings doesn't even try to save them if config isn't changed. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@871 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-23more enum fixesTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@862 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-23several fixes to make irssi compile without warnings with MIPSproTimo Sirainen
also fixed ctcp_queue_clean() - it might have crashed sometimes.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@859 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-09-06config_node_clear() didn't work right.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@648 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-08-26Lots of moving stuff around - hopefully I didn't break too much :)Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@632 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-08-16Small memleak fixedTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@613 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-08-01fixTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@573 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-07-10Enabled lots of GCC warnings, fixed those that were easy to fix.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@456 dbcabf3a-b0e7-0310-adc4-f8d773084564