1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00
Commit Graph

26 Commits

Author SHA1 Message Date
ailin-nemui
f9beedd2d0 add more config checks and assertions 2019-01-22 15:24:52 +01:00
Peder Stray
6b56f098e9 Change g_hash_table_contains() for compatibility with glib < 2.32 2015-04-20 08:01:01 +02:00
Ailin Nemui
fef25d6a35 Make the config parser more robust
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-17 09:50:55 +01:00
Ailin Nemui
af6b789d2a Warn the user instead of crashing on wrong config
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-17 09:50:55 +01:00
Ailin Nemui
96d4fb9156 add CONFIG_REC to config_node_section* APIs
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.
2015-02-17 09:50:55 +01:00
David Leadbeater
db62ddfd55 Die if the wrong type of node is found when traversing config
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-12-16 12:14:23 +00:00
David Hill
0d4f13d20f Replace deprecated g_str[n]casecmp with g_ascii_str[n]cmp. 2014-06-10 12:06:19 -04:00
Alexander Færøy
c561ba35e6 Code Cleanup:
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-02-08 17:22:42 +00:00
Emanuele Giaquinta
1da5914177 Remove unused and odd function.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4985 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-14 17:53:57 +00:00
Emanuele Giaquinta
75352a5998 Keep documentation for public api only in headers to avoid duplication.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4755 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-11 13:25:33 +00:00
Wouter Coekaerts
9c2d621cc6 Oops. Update address correctly now.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08 18:41:10 +00:00
Wouter Coekaerts
023026e12b Update FSF address
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4489 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08 18:16:58 +00:00
Timo Sirainen
b05cfc62e0 config_node_nth() and config_node_index() don't count comments in config
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-10-25 13:57:16 +00:00
Timo Sirainen
7b2f9bc50a removed useless functions
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2804 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-05-17 21:00:38 +00:00
Timo Sirainen
b38f4da166 renamed old config_node_index() to config_node_nth(). added new
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-02-15 22:18:35 +00:00
Timo Sirainen
f4897860b5 toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in some
systems, use our own is_...() functions now instead.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-27 20:45:59 +00:00
Timo Sirainen
80df4378d3 added config_node_first() function to get the first non-comment node.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1812 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-09-22 15:24:40 +00:00
Timo Sirainen
5976d82fa7 config_node_next() - Returns the next non-comment node in list. Use this
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-09-22 14:53:54 +00:00
Timo Sirainen
8ce36c05ea several fixes to make irssi compile without warnings with MIPSpro
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-11-23 21:40:07 +00:00
Timo Sirainen
e395e87ded Lots of moving stuff around - hopefully I didn't break too much :)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@632 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-08-26 15:39:44 +00:00
Timo Sirainen
8dab451d18 Small memleak fixed
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@613 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-08-16 00:48:51 +00:00
Timo Sirainen
4282f07347 If config_node_get_str() is given NULL node, return the given default.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@301 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-06-06 19:14:51 +00:00
Timo Sirainen
bb4d7566c2 iconfig's caching was a bit buggy - it didn't notice if some config node was
removed.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@213 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-05-10 13:57:42 +00:00
Timo Sirainen
d29ca0b107 rest of the ~rewrite?
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@172 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-04-26 08:10:09 +00:00
Timo Sirainen
4482d518b8 section can be NULL - which is same as "". Fixed several functions to allow
it.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@164 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-04-14 12:49:02 +00:00
Timo Sirainen
53b248f6de Sorry for a big update - I still don't have internet connection at home
and this is what I've been doing a few weeks now.. :) You really shouldn't
upgrade to this version without keeping a backup of the working one, since
this will break everything and at least notify list is broken - probably
something else too.

* On the way to 0.8.0 .. Major rewriting/rearranging code. There's
  some changes in behaviour because I'm trying to make Irssi a bit
  more compatible with EPIC.

* libPropList isn't needed anymore - I'm using my own configuration
  library. This is mostly because different proplists worked a bit
  differently everywhere and several people had problems with it.
  It's also yet another extra library that you needed to compile
  Irssi. New configuration library has several advantages:

  You can add comments to configuration file and they also stay
  there when it's saved.

  It's not nearly as vulnerable as proplist. If some error occurs,
  instead of just not reading anything it will try to continue if
  possible. Also the error messages are written to irssi's text
  window instead of stdout.

  It can be managed more easily than proplist - setting/getting the
  configuration is a lot more easier.

* Coding style changes - I'm not using gint, gchar etc. anymore,
  they're just extra pain when moving code to non-glib projects and
  syntax hilighting doesn't work by default with most editors ;)

  Indentation style was also changed to K&R because of some political
  reasons ;) And I'm already starting to like it.. :) It forces me
  to split code to different functions more often and the result is
  that the code gets more readable.

  And finally I'm also using nst' all over the place.

+ /EVAL <commands> - Expand all the special variables from string and
  run it. Commands can be split with ; character. See
  docs/SPECIAL_VARS for more info.
+ Aliases are parsed just like /EVAL - arguments are in $0..$9.
+ Text formats are also parsed like /EVAL, arguments used to be in
  $1..$9, now they're in $0..$8 so it messes up existing themes..
+ /SET [key [value]] - no more the '=' character. Boolean values
  also need to be changed with ON/OFF/TOGGLE values (not yes/no).
  Settings aren't saved to disk until you use /SAVE.
+ /TOGGLE <key> [ON/OFF] - same as /SET <key> TOGGLE


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@163 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-04-14 11:27:14 +00:00