bday

diff birthday.c @ 5:5af6bf2cb271

reads only stdin now, no files anymore; removed -f option aswell; code beatifing
author meillo@marmaro.de
date Mon, 17 Dec 2007 15:09:03 +0100
parents dc2f94280b01
children fc6e40f7bd5a
line diff
     1.1 --- a/birthday.c	Mon Dec 17 12:14:41 2007 +0100
     1.2 +++ b/birthday.c	Mon Dec 17 15:09:03 2007 +0100
     1.3 @@ -34,14 +34,10 @@
     1.4  
     1.5  int main(int argc, char* argv[])
     1.6  {
     1.7 -  char* fname = NULL;
     1.8    struct event *evl; /* evl => event list */
     1.9  
    1.10    while (--argc > 0 && (*++argv)[0] == '-') {
    1.11 -    if (strcmp(argv[0], "-f") == 0) {
    1.12 -			fname = strdup((++argv)[0]);
    1.13 -			argc--;
    1.14 -		} else if (strcmp(argv[0], "-W") == 0) {
    1.15 +		if (strcmp(argv[0], "-W") == 0) {
    1.16  			iDWarn = atoi((++argv)[0]);
    1.17  			argc--;
    1.18  		} else {
    1.19 @@ -50,8 +46,7 @@
    1.20  		}
    1.21  	}
    1.22  
    1.23 -  evl = readlist(fname); /* read and format entries */
    1.24 -
    1.25 +  evl = readlist(); /* read and format entries */
    1.26  	liststrings(evl, puts);
    1.27  
    1.28    return 0;