aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);