summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2015-11-11Refactor strtrim functionSilvan Jegen
Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-27Use ARRAYSIZE macro for non-string array size computationPierre Neidhardt
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20move ini parser into commonAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20move strtrim to util-commonAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03common: Avoid errors on systems that define strnlen but not strndupWill Miles
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>
2015-02-01Update copyright notices for 2015Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-09-23wrap fgets to retry on EINTRAndrew Gregory
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>
2014-08-03llstat: modify path in placeAndrew Gregory
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>
2014-08-03move _alpm_lstat into util-commonAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2014-01-28Remove ts and sw from vim modeline when noet is setFlorian Pritz
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>
2014-01-06Update copyright years for 2014Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15Fix whitespace and other formatting issuesJason St. John
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>
2013-09-04common: compare value rather than pointer addressSami Kerola
Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-14update util-common.h copyright yearAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Split common utility functions for libalpm and pacmanAllan McRae
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>