]> git.pld-linux.org Git - packages/poldek.git/blame - poldek-completion.patch
- complete URL
[packages/poldek.git] / poldek-completion.patch
CommitLineData
f304a8a2
JB
1===================================================================
2RCS file: /cvsroot/installer/poldek/cli/shell.c,v
3retrieving revision 1.27
4retrieving revision 1.28
5diff -u -r1.27 -r1.28
6--- installer/poldek/cli/shell.c 2005/11/06 19:26:27 1.27
7+++ installer/poldek/cli/shell.c 2005/11/10 19:21:04 1.28
f304a8a2
JB
8@@ -76,13 +76,13 @@
9 struct pkg *ipkg = NULL;
10 tn_array *dents;
11 char name[256];
12- int n;
13+ int n, name_len;
14
15 dents = poclidek_get_dent_ents(cctx, POCLIDEK_INSTALLEDDIR);
16 if (dents == NULL)
17 return 1;
18
19- snprintf(name, sizeof(name), "%s-", pkg->name);
20+ name_len = snprintf(name, sizeof(name), "%s-", pkg->name);
21 n = n_array_bsearch_idx_ex(dents, name, (tn_fn_cmp)pkg_dent_strncmp);
22
23 if (n == -1)
24@@ -90,14 +90,15 @@
25
26 while (n < n_array_size(dents)) {
27 struct pkg_dent *ent = n_array_nth(dents, n++);
28+
29 if (pkg_dent_isdir(ent))
30 continue;
31+
32+ if (strncmp(name, ent->name, name_len) != 0)
33+ break;
34
35 ipkg = ent->pkg_dent_pkg;
36- if (strcmp(pkg->name, ipkg->name) != 0)
37- break;
38-
39- if (pkg_cmp_evr(pkg, ipkg) > 0)
40+ if (strcmp(pkg->name, ipkg->name) == 0 && pkg_cmp_evr(pkg, ipkg) > 0)
41 return 1;
42
43 }
This page took 0.03501 seconds and 4 git commands to generate.