added :octal for int32 and int16
authorewt <devnull@localhost>
Fri, 17 Jan 1997 22:56:22 +0000 (22:56 +0000)
committerewt <devnull@localhost>
Fri, 17 Jan 1997 22:56:22 +0000 (22:56 +0000)
CVS patchset: 1324
CVS date: 1997/01/17 22:56:22

query.c

diff --git a/query.c b/query.c
index 46e1f7c..9bdd32e 100644 (file)
--- a/query.c
+++ b/query.c
@@ -264,6 +264,9 @@ static char * handleFormat(Header h, char * chptr, int * cntptr,
        if (!strcmp(how, "perms") || !strcmp(how, "permissions")) {
            strcat(format, "s");
            printf(format, permsString(*(((int_16 *) p) + arrayNum)));
+       } else if (!strcmp(how, "octal")) {
+           strcat(format, "#o");
+           printf(format, *(((int_16 *) p) + arrayNum) & 0xFFFF);
        } else {
            strcat(format, "d");
            printf(format, *(((int_16 *) p) + arrayNum));
@@ -287,6 +290,9 @@ static char * handleFormat(Header h, char * chptr, int * cntptr,
            if (anint & RPMFILE_CONFIG)
                strcat(buf, "c");
            printf(format, buf);
+       } else if (!strcmp(how, "octal")) {
+           strcat(format, "#o");
+           printf(format, *(((int_32 *) p) + arrayNum));
        } else if (!strcmp(how, "perms") || !strcmp(how, "permissions")) {
            strcat(format, "s");
            printf(format, permsString(*(((int_32 *) p) + arrayNum)));