1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-13 05:03:45 -04:00
Commit Graph

19 Commits

Author SHA1 Message Date
Ailin Nemui
1131a881cf change realpath to use syntax based on _POSIX_VERSION 2023-08-08 07:59:31 +02:00
ailin-nemui
9e13892e28 fix realpath on old solaris
POSIX.1-2001 did not implement realpath(..., NULL) yet.
Fixes #1042
2019-05-13 15:15:46 +02:00
dequis
3351c54a2f Fix /save not working if the config didn't previously exist
realpath() was supposed to resolve symlinks but it also fails with
ENOENT (no such file or directory) if the file just isn't there.
2018-09-01 19:12:17 -03:00
Lukas Waymann
7d3eb47ab5 Fix potential rename(3) across file systems
Make sure the temporary file in the `config_write` function is created
on the same file system as the file we `rename` it to later.
2018-08-12 10:55:47 +00:00
Lukas Waymann
764f8215a9 Fix /save replacing symlinks with regular files
A side-effect of 8deb618 is that `/save` may replace configuration files
that are symlinks with regular files.  Fix this by resolving all
symlinks before renaming the temporary file.
2018-08-12 07:22:14 +00:00
dequis
8deb6182c6 Make config_write more atomic to prevent truncation when out of space
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.
2018-04-08 15:52:09 -03:00
Emanuele Giaquinta
b38b75bbb4 Add forgotten g_io_channel_set_close_on_unref call to close the config file fd
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-10-23 21:17:03 +00: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
4534ef242d Use an io channel to write the config file.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4990 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-16 17:12:27 +00:00
Emanuele Giaquinta
169c55b949 Simplify, use 'o' printf conversion specifier to print number in octal.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4904 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-12 23:13: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
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
a2d9661982 Don't write indent spaces to empty lines
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1085 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-07 08:05:14 +00:00
Timo Sirainen
fbad9ef2ba Config file handle wasn't closed if config_write_block() failed
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@993 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-12-16 23:38:12 +00:00
Timo Sirainen
0238eeb5e2 If name tag contains '_', it shouldn't be quoted.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@333 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-06-14 17:31:53 +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
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