Skip to content

Commit

Permalink
v0.6 - fix "Invalid argument" error on empty file
Browse files Browse the repository at this point in the history
  • Loading branch information
abbat committed Mar 12, 2019
1 parent 8fdea8c commit 7407850
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Anton Batenev <antonbatenev@yandex.ru>

pkgname=timegrep
pkgver=0.5
pkgver=0.6
pkgrel=1
pkgdesc='Utility to grep log between two dates or tail last lines to time ago'
arch=('i686' 'x86_64')
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
timegrep (0.6) unstable; urgency=low

* Fix "Invalid argument" error on empty file.

-- Anton Batenev <antonbatenev@yandex.ru> Tue, 12 Mar 2019 12:11:41 +0300

timegrep (0.5) unstable; urgency=low

* Fix multiline parsing.
Expand Down
4 changes: 3 additions & 1 deletion timegrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/**
* Program version for --version, -v
*/
static const char* TG_VERSION = "0.5";
static const char* TG_VERSION = "0.6";

/**
* Default chunk size for io / memory in bytes (512KB)
Expand Down Expand Up @@ -1543,6 +1543,8 @@ int main(int argc, char* argv[])

if (fstat(ctx.fd, &file_stat) == -1)
goto ERROR;
else if (file_stat.st_size == 0)
goto SUCCESS;

ctx.size = file_stat.st_size;

Expand Down
4 changes: 2 additions & 2 deletions timegrep.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: timegrep
Version: 0.5
Version: 0.6
Release: 1
Summary: Utility to grep log between two dates or tail last lines to time ago
Group: Productivity/Text/Utilities
Expand Down Expand Up @@ -47,5 +47,5 @@ rm -rf %{buildroot}


%changelog
* Tue Jul 24 2018 Anton Batenev <antonbatenev@yandex.ru> 0.5-1
* Tue Mar 12 2019 Anton Batenev <antonbatenev@yandex.ru> 0.6-1
- Initial RPM release

0 comments on commit 7407850

Please sign in to comment.