summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-03-04 09:16:28 +0000
committerAaron Griffin <aaron@archlinux.org>2007-03-04 09:16:28 +0000
commit28b2dbb52c8b7bb0b611b2e86cef69f3e911facb (patch)
tree47a6082d788dbd7bebf0ee1bada33ab2aab67c59
parentcdb46ef3fa6d2bea95ae45b8b807497982b18fd5 (diff)
downloadpacman-28b2dbb52c8b7bb0b611b2e86cef69f3e911facb.tar.xz
* Fixed the handle realroot stuff
* Added some {}
-rw-r--r--lib/libalpm/handle.c10
-rw-r--r--src/pacman/pacman.c3
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index c17d86a5..b044adcb 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -155,13 +155,13 @@ void alpm_option_set_root(const char *root)
/* According to the man page, realpath is safe to use IFF the second arg is
* NULL. */
char *realroot = realpath(root, NULL);
- if(!realroot) {
- realroot = root;
+ if(realroot) {
+ root = realroot;
+ } else {
_alpm_log(PM_LOG_ERROR, _("cannot canonicalize specified root path '%s'"), root);
}
- /* check again, in case both are null */
- if(realroot) {
+ if(root) {
/* verify root ends in a '/' */
int rootlen = strlen(realroot);
if(realroot[rootlen-1] != '/') {
@@ -172,6 +172,8 @@ void alpm_option_set_root(const char *root)
handle->root[rootlen-1] = '/';
_alpm_log(PM_LOG_DEBUG, _("option 'root' = %s"), handle->root);
+ }
+ if(realroot) {
free(realroot);
}
}
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index d608a1c6..e2a5eec9 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -434,8 +434,9 @@ int main(int argc, char *argv[])
}
/* workaround for tr_TR */
- if(lang && !strcmp(lang, "tr_TR"))
+ if(lang && !strcmp(lang, "tr_TR")) {
setlocale(LC_CTYPE, "C");
+ }
bindtextdomain("pacman", "/usr/share/locale");
textdomain("pacman");