1 |
vapier 11/03/01 06:11:54 |
2 |
|
3 |
Modified: qfile.c |
4 |
Log: |
5 |
make sure ROOT works properly |
6 |
|
7 |
Revision Changes Path |
8 |
1.56 portage-utils/qfile.c |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qfile.c?rev=1.56&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qfile.c?rev=1.56&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qfile.c?r1=1.55&r2=1.56 |
13 |
|
14 |
Index: qfile.c |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v |
17 |
retrieving revision 1.55 |
18 |
retrieving revision 1.56 |
19 |
diff -u -r1.55 -r1.56 |
20 |
--- qfile.c 21 Feb 2011 07:33:21 -0000 1.55 |
21 |
+++ qfile.c 1 Mar 2011 06:11:54 -0000 1.56 |
22 |
@@ -1,7 +1,7 @@ |
23 |
/* |
24 |
* Copyright 2005-2010 Gentoo Foundation |
25 |
* Distributed under the terms of the GNU General Public License v2 |
26 |
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.55 2011/02/21 07:33:21 vapier Exp $ |
27 |
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qfile.c,v 1.56 2011/03/01 06:11:54 vapier Exp $ |
28 |
* |
29 |
* Copyright 2005-2010 Ned Ludd - <solar@g.o> |
30 |
* Copyright 2005-2010 Mike Frysinger - <vapier@g.o> |
31 |
@@ -34,7 +34,7 @@ |
32 |
"Display installed packages with slots", |
33 |
COMMON_OPTS_HELP |
34 |
}; |
35 |
-static const char qfile_rcsid[] = "$Id: qfile.c,v 1.55 2011/02/21 07:33:21 vapier Exp $"; |
36 |
+static const char qfile_rcsid[] = "$Id: qfile.c,v 1.56 2011/03/01 06:11:54 vapier Exp $"; |
37 |
#define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, qfile_opts_help, lookup_applet_idx("qfile")) |
38 |
|
39 |
#define qfile_is_prefix(path, prefix, prefix_length) \ |
40 |
@@ -488,7 +488,7 @@ |
41 |
char *p; |
42 |
short search_orphans = 0; |
43 |
short assume_root_prefix = 0; |
44 |
- char *root_prefix = NULL; |
45 |
+ char *root_prefix; |
46 |
char *exclude_pkg_arg = NULL; |
47 |
qfile_args_t *qfile_args = NULL; |
48 |
int qargc = 0; |
49 |
@@ -497,7 +497,7 @@ |
50 |
FILE *args_file = NULL; |
51 |
int max_args = QFILE_DEFAULT_MAX_ARGS; |
52 |
size_t buflen; |
53 |
- char *buf = NULL; |
54 |
+ char *buf; |
55 |
|
56 |
DBG("argc=%d argv[0]=%s argv[1]=%s", |
57 |
argc, argv[0], argc > 1 ? argv[1] : "NULL?"); |
58 |
@@ -552,8 +552,10 @@ |
59 |
if ((args_file == NULL) && (max_args != QFILE_DEFAULT_MAX_ARGS)) |
60 |
warn("--max-args is only used when reading arguments from a file (with -f)"); |
61 |
|
62 |
- xchdir(portroot); |
63 |
- xchdir(portvdb); |
64 |
+ xasprintf(&buf, "%s/%s", portroot, portvdb); |
65 |
+ xchdir(buf); |
66 |
+ free(buf); |
67 |
+ buf = NULL; |
68 |
|
69 |
/* Get a copy of $ROOT, with no trailing slash |
70 |
* (this one is just for qfile(...) output) |
71 |
@@ -655,8 +657,7 @@ |
72 |
free(qfile_args); |
73 |
} |
74 |
|
75 |
- if (root_prefix != NULL) |
76 |
- free(root_prefix); |
77 |
+ free(root_prefix); |
78 |
|
79 |
return (found ? EXIT_SUCCESS : EXIT_FAILURE); |
80 |
} |