diff options
author | Antti-Juhani Kaijanaho <ajk@debian.org> | 2010-09-11 22:43:49 +0300 |
---|---|---|
committer | Antti-Juhani Kaijanaho <ajk@debian.org> | 2010-09-11 22:43:49 +0300 |
commit | a83883f738f737a931bfe0b710896aef59437790 (patch) | |
tree | 2a31b129f3f71a4d4607581054cecebebc93aecb /grep-dctrl | |
parent | e5a19977f4ec1187b5c358dbd5dfb6869a00f106 (diff) | |
download | dctrl-tools-a83883f738f737a931bfe0b710896aef59437790.tar.gz |
tbl-dctrl: Figure out the fields from the input if no '-c' is given.
Closes: #596424 reported by myself
Signed-off-by: Antti-Juhani Kaijanaho <ajk@debian.org>
Diffstat (limited to 'grep-dctrl')
-rw-r--r-- | grep-dctrl/grep-dctrl.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/grep-dctrl/grep-dctrl.c b/grep-dctrl/grep-dctrl.c index 07c5ed6..4f26168 100644 --- a/grep-dctrl/grep-dctrl.c +++ b/grep-dctrl/grep-dctrl.c @@ -766,11 +766,14 @@ static void show_field(struct arguments *args, struct paragraph *para, struct field_attr *fa) { - struct fsaf_read_rv r - = get_field(para, - fa->inx, - GET_BACKUP_FIELD(fa->application_data)); - + struct field_data *fd = + find_field_wr(para, + fa->inx, + GET_BACKUP_FIELD(fa->application_data)); + if (fd == NULL) return; + struct fsaf_read_rv r = + fsaf_read(para->common->fp, fd->start, fd->end - fd->start); + if (args->short_descr && fa == description_attr) { char * nl = memchr(r.b, '\n', r.len); |