summaryrefslogtreecommitdiff
path: root/src/common/util-common.c
Commit message (Collapse)AuthorAge
* Update copyright yearsAllan McRae2017-01-04
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2016Allan McRae2016-01-04
| | | | | | make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
* Refactor strtrim functionSilvan Jegen2015-11-11
| | | | | Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* move strtrim to util-commonAndrew Gregory2015-09-20
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* common: Avoid errors on systems that define strnlen but not strndupWill Miles2015-03-03
| | | | | | | | Add a configure test for a system library supplied strnlen, and disable the embedded version in common if one is found. Signed-off-by: Will Miles <wmiles@sgl.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright notices for 2015Allan McRae2015-02-01
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* wrap fgets to retry on EINTRAndrew Gregory2014-09-23
| | | | | | | | | | The read() underlying fgets() can be interrupted by a signal handler causing fgets() to return NULL. Before we started handling SIGWINCH, the odds of interrupting a read were low and typically resulted in termination anyway. Replace all fgets calls with a wrapper that retries in EINTR. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* llstat: modify path in placeAndrew Gregory2014-08-03
| | | | | | | | | | This makes llstat's signature differ from lstat's, but we never actually use it on a const string and this saves a large number of strdup's. This also allows stripping multiple trailing slashes and corrects a bug where calling llstat on "/" would result in calling lstat on an empty string. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* move _alpm_lstat into util-commonAndrew Gregory2014-08-03
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* Remove ts and sw from vim modeline when noet is setFlorian Pritz2014-01-28
| | | | | | | | | | | | Forcing vim users to view files with a tabstop of 2 seems really unnecessary when noet is set. I find it much easier to read code with ts=4 and I dislike having to override the modeline by hand. Command run: find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} + Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2014Allan McRae2014-01-06
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix whitespace and other formatting issuesJason St. John2013-11-15
| | | | | | | | | This commit: -- replaces space-based indents with tabs per the coding standards -- removes extraneous whitespace (e.g. extra spaces between function args) -- adds missing braces for a one-line if statement Signed-off-by: Jason St. John <jstjohn@purdue.edu>
* common: compare value rather than pointer addressSami Kerola2013-09-04
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Allan McRae <allan@archlinux.org>
* update util-common.h copyright yearAllan McRae2013-03-14
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Split common utility functions for libalpm and pacmanAllan McRae2013-01-04
There is duplicated code in the util.c files in the libalpm and pacman source code. Split this into a separate file so that it can be shared via a symlink. This prevents code divergence between the two code bases. Also, move mbasename and mdirname from pacman/util.c into util-common.c in preparation for the following patch that uses them to add an extension to pacsave files. Signed-off-by: Allan McRae <allan@archlinux.org>