summaryrefslogtreecommitdiff
path: root/src/general.c
AgeCommit message (Collapse)Author
2020-05-01print_file_contents: Resolve tildeOrestis Floros
Fixes #350
2020-05-01Move general functions scalloc, sstrdup out of i3status.cOrestis Floros
2019-09-19Mention the return value of the slurp function and the implicationsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2019-09-19Do not return true from slurp() if it failed to readOlivier Gayot
Failing to read() some data into the destination buffer from the slurp() function was not considered an error. This means that we were potentially leaving the caller with an uninitialized destination buffer without letting him know it's uninitialized. It is quite unlikely that a single call to read() would ever fail right after a successful call to open(..., O_RDONLY). However, one practical example of this happening is when the file being opened is actually a directory. Fixed by propagating the error (i.e. returning false from slurp()) if the call to read() fails. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2019-01-23Switch to autotools (#316)Michael Stapelberg
2018-06-20No longer use a temporary buffer in the die() functionOlivier Gayot
Before the following change f947d0a Breaks configfiles! Major refactoring of i3status, see below The die(fmt, ...) function was outputting the reason to the status bar in addition to stderr. For this reason, it was meaningful to create a temporary string according to the format string and then passing it around to the different functions. Nowadays, we only display the error message to stderr so calling fprintf(stderr, ...) is much simpler. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2015-03-16clang-format-3.5 -i **/*.[ch], update modelineMichael Stapelberg
From here on, we’ll use clang-format to automatically format the source. This has worked well in i3, so we are introducing it for i3status.
2013-11-22Add support for path_exists directive.Kinware AB
2013-11-09fix slurp(), it needs to read size-1 for the trailing NULMichael Stapelberg
2011-07-13slurp(): null-terminate buffer (Thanks mist)Michael Stapelberg
2010-11-28Use kill(pid, 0) to check if the process is aliveMichael Stapelberg
2009-10-11Breaks configfiles! Major refactoring of i3status, see belowMichael Stapelberg
We finally switched to libconfuse for a configuration file format which does not require much work for the programmer nor for the user. Plus, it avoids the Not-Invented-Here syndrome of yet another config file format. Furthermore, as a consequence of providing format strings for every "module" (ipv6, wireless, …), we directly print the output and thus we needed to drop support for wmii. This allowed us to get rid of quite some complexity. Documentation about the new configuration file and options will follow. This commit is the beginning of what will be i3status v2.0.
2009-07-25Return "no battery" instead of dying if a battery wasn’t found (Thanks Mirko)Michael Stapelberg
2009-07-21Add modelines and retab! all filesMichael Stapelberg
2009-07-21Correctly handle the order of itemsMichael Stapelberg
2009-07-21Use own files for each function, add get_ipv6_addr.cMichael Stapelberg