aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-05-13 22:59:31 +0000
committerMike Frysinger <vapier@gentoo.org>2006-05-13 22:59:31 +0000
commit6a07e1aa17ad68b8aea68ce346adc7253bb47ec4 (patch)
tree59374a9443ac093e4c9a0280233c82d0f7b4fae0 /qfile.c
parentdont rely on errno, check the return value of realpath() (diff)
downloadportage-utils-6a07e1aa17ad68b8aea68ce346adc7253bb47ec4.tar.gz
portage-utils-6a07e1aa17ad68b8aea68ce346adc7253bb47ec4.tar.bz2
portage-utils-6a07e1aa17ad68b8aea68ce346adc7253bb47ec4.zip
on second thought, dont check the return value of realpath() as it is ok if we fall throughv0.1.17
Diffstat (limited to 'qfile.c')
-rw-r--r--qfile.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/qfile.c b/qfile.c
index 4c06e9ca..7e48f2a9 100644
--- a/qfile.c
+++ b/qfile.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.27 2006/05/13 22:49:31 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.28 2006/05/13 22:59:31 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -18,7 +18,7 @@ static const char *qfile_opts_help[] = {
"Exact match",
COMMON_OPTS_HELP
};
-static char qfile_rcsid[] = "$Id: qfile.c,v 1.27 2006/05/13 22:49:31 vapier Exp $";
+static char qfile_rcsid[] = "$Id: qfile.c,v 1.28 2006/05/13 22:59:31 vapier Exp $";
#define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, qfile_opts_help, lookup_applet_idx("qfile"))
void qfile(char *path, char *fullname);
@@ -40,7 +40,11 @@ void qfile(char *path, char *fullname)
if ((fname[0] == '.') && ((p = getenv("PWD")) != NULL)) {
char tmp[PATH_MAX];
snprintf(tmp, sizeof(fname), "%s/%s", p, fullname);
- assert(realpath(tmp, fname) != NULL);
+ /* Don't check the return value here as it is ok if
+ * the function fails. Think of the case where fname
+ * is '...somefile', we don't want to abort then as
+ * the value in fname will be unchanged. */
+ realpath(tmp, fname);
}
flen = strlen(fname);