mirror of
https://git.busybox.net/busybox.git
synced 2024-11-23 13:43:28 +08:00
libbb/dump: make xxd_displayoff member conditional on xxd
With xxd not selected: function old new delta display 1459 1444 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
6d9427420b
commit
9225f9684f
@ -33,14 +33,14 @@ typedef struct dumper_t {
|
||||
int dump_length; /* max bytes to read */
|
||||
smallint dump_vflag; /*enum dump_vflag_t*/
|
||||
FS *fshead;
|
||||
#if ENABLE_XXD
|
||||
const char *xxd_eofstring;
|
||||
#endif
|
||||
#if ENABLE_OD
|
||||
const char *od_eofstring;
|
||||
#endif
|
||||
off_t address; /* address/offset in stream */
|
||||
#if ENABLE_XXD
|
||||
const char *xxd_eofstring;
|
||||
long long xxd_displayoff;
|
||||
#endif
|
||||
off_t address; /* address/offset in stream */
|
||||
} dumper_t;
|
||||
|
||||
dumper_t* alloc_dumper(void) FAST_FUNC;
|
||||
|
12
libbb/dump.c
12
libbb/dump.c
@ -590,7 +590,11 @@ static NOINLINE void display(priv_dumper_t* dumper)
|
||||
}
|
||||
switch (pr->flags) {
|
||||
case F_ADDRESS:
|
||||
printf(pr->fmt, (unsigned long long) dumper->pub.address + dumper->pub.xxd_displayoff);
|
||||
printf(pr->fmt, (unsigned long long) dumper->pub.address
|
||||
#if ENABLE_XXD
|
||||
+ dumper->pub.xxd_displayoff
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case F_BPAD:
|
||||
printf(pr->fmt, "");
|
||||
@ -699,7 +703,11 @@ static NOINLINE void display(priv_dumper_t* dumper)
|
||||
for (pr = dumper->endfu->nextpr; pr; pr = pr->nextpr) {
|
||||
switch (pr->flags) {
|
||||
case F_ADDRESS:
|
||||
printf(pr->fmt, (unsigned long long) dumper->eaddress + dumper->pub.xxd_displayoff);
|
||||
printf(pr->fmt, (unsigned long long) dumper->eaddress
|
||||
#if ENABLE_XXD
|
||||
+ dumper->pub.xxd_displayoff
|
||||
#endif
|
||||
);
|
||||
break;
|
||||
case F_TEXT:
|
||||
fputs_stdout(pr->fmt);
|
||||
|
Loading…
Reference in New Issue
Block a user