Skip to content

Commit 7407850

Browse files
committed
v0.6 - fix "Invalid argument" error on empty file
1 parent 8fdea8c commit 7407850

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

PKGBUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maintainer: Anton Batenev <[email protected]>
22

33
pkgname=timegrep
4-
pkgver=0.5
4+
pkgver=0.6
55
pkgrel=1
66
pkgdesc='Utility to grep log between two dates or tail last lines to time ago'
77
arch=('i686' 'x86_64')

debian/changelog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
timegrep (0.6) unstable; urgency=low
2+
3+
* Fix "Invalid argument" error on empty file.
4+
5+
-- Anton Batenev <[email protected]> Tue, 12 Mar 2019 12:11:41 +0300
6+
17
timegrep (0.5) unstable; urgency=low
28

39
* Fix multiline parsing.

timegrep.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
/**
5151
* Program version for --version, -v
5252
*/
53-
static const char* TG_VERSION = "0.5";
53+
static const char* TG_VERSION = "0.6";
5454

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

15441544
if (fstat(ctx.fd, &file_stat) == -1)
15451545
goto ERROR;
1546+
else if (file_stat.st_size == 0)
1547+
goto SUCCESS;
15461548

15471549
ctx.size = file_stat.st_size;
15481550

timegrep.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: timegrep
2-
Version: 0.5
2+
Version: 0.6
33
Release: 1
44
Summary: Utility to grep log between two dates or tail last lines to time ago
55
Group: Productivity/Text/Utilities
@@ -47,5 +47,5 @@ rm -rf %{buildroot}
4747

4848

4949
%changelog
50-
* Tue Jul 24 2018 Anton Batenev <[email protected]> 0.5-1
50+
* Tue Mar 12 2019 Anton Batenev <[email protected]> 0.6-1
5151
- Initial RPM release

0 commit comments

Comments
 (0)