aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-09-07 11:48:25 +0100
committerRon Yorston <rmy@pobox.com>2012-09-07 11:48:25 +0100
commitfecf687cc358883de2da21de33346f0df204c80b (patch)
treed22c606157926fb659374ae68d55e3a874bacf25 /modutils
parentb25a7c28a0f684087fa6ccbbc7e265a9cac0f0fa (diff)
parent6d463de46b418e6c4c8d1397033608f78b33ab21 (diff)
downloadbusybox-w32-fecf687cc358883de2da21de33346f0df204c80b.tar.gz
busybox-w32-fecf687cc358883de2da21de33346f0df204c80b.tar.bz2
busybox-w32-fecf687cc358883de2da21de33346f0df204c80b.zip
Merge branch 'busybox' into merge
Conflicts: include/libbb.h shell/ash.c
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modinfo.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/modutils/modinfo.c b/modutils/modinfo.c
index c0910ffed..7c978d1da 100644
--- a/modutils/modinfo.c
+++ b/modutils/modinfo.c
@@ -24,9 +24,9 @@
24 24
25 25
26enum { 26enum {
27 OPT_TAGS = (1 << 8) - 1, 27 OPT_TAGS = (1 << 12) - 1, /* shortcut count */
28 OPT_F = (1 << 8), /* field name */ 28 OPT_F = (1 << 12), /* field name */
29 OPT_0 = (1 << 9), /* \0 as separator */ 29 OPT_0 = (1 << 13), /* \0 as separator */
30}; 30};
31 31
32struct modinfo_env { 32struct modinfo_env {
@@ -49,13 +49,17 @@ static void modinfo(const char *path, const char *version,
49{ 49{
50 static const char *const shortcuts[] = { 50 static const char *const shortcuts[] = {
51 "filename", 51 "filename",
52 "description",
53 "author",
54 "license", 52 "license",
53 "author",
54 "description",
55 "version",
56 "alias",
57 "srcversion",
58 "depends",
59 "uts_release",
55 "vermagic", 60 "vermagic",
56 "parm", 61 "parm",
57 "firmware", 62 "firmware",
58 "depends",
59 }; 63 };
60 size_t len; 64 size_t len;
61 int j, length; 65 int j, length;
@@ -97,8 +101,11 @@ static void modinfo(const char *path, const char *version,
97 if (ptr == NULL) /* no occurance left, done */ 101 if (ptr == NULL) /* no occurance left, done */
98 break; 102 break;
99 if (strncmp(ptr, pattern, length) == 0 && ptr[length] == '=') { 103 if (strncmp(ptr, pattern, length) == 0 && ptr[length] == '=') {
100 ptr += length + 1; 104 /* field prefixes are 0x80 or 0x00 */
101 ptr += display(ptr, pattern, (1<<j) != tags); 105 if ((ptr[-1] & 0x7F) == '\0') {
106 ptr += length + 1;
107 ptr += display(ptr, pattern, (1<<j) != tags);
108 }
102 } 109 }
103 ++ptr; 110 ++ptr;
104 } 111 }
@@ -131,7 +138,7 @@ int modinfo_main(int argc UNUSED_PARAM, char **argv)
131 138
132 env.field = NULL; 139 env.field = NULL;
133 opt_complementary = "-1"; /* minimum one param */ 140 opt_complementary = "-1"; /* minimum one param */
134 opts = getopt32(argv, "fdalvpF:0", &env.field); 141 opts = getopt32(argv, "nladvAsDumpF:0", &env.field);
135 env.tags = opts & OPT_TAGS ? opts & OPT_TAGS : OPT_TAGS; 142 env.tags = opts & OPT_TAGS ? opts & OPT_TAGS : OPT_TAGS;
136 argv += optind; 143 argv += optind;
137 144