Code cleanup
This commit is contained in:
parent
70aec3c187
commit
2bce4dc280
15
src/head.c
15
src/head.c
|
@ -1,5 +1,5 @@
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
/* Copyright (c) 2007 Pierre Pronchery <khorben@defora.org> */
|
/* Copyright (c) 2009 Pierre Pronchery <khorben@defora.org> */
|
||||||
/* This file is part of DeforaOS Unix utils */
|
/* This file is part of DeforaOS Unix utils */
|
||||||
/* utils is not free software; you can redistribute it and/or modify it under
|
/* utils is not free software; you can redistribute it and/or modify it under
|
||||||
* the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
* the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||||
|
@ -23,16 +23,17 @@
|
||||||
|
|
||||||
/* head */
|
/* head */
|
||||||
static int _head_error(char const * message, int ret);
|
static int _head_error(char const * message, int ret);
|
||||||
static int _head_do(int flgn, char * filename);
|
static int _head_do(int flgn, char const * filename);
|
||||||
static int _head(int flgn, int argc, char * argv[])
|
|
||||||
|
static int _head(int flgn, int filec, char * filev[])
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(argc == 0)
|
if(filec == 0)
|
||||||
return _head_do(flgn, NULL);
|
return _head_do(flgn, NULL);
|
||||||
for(i = 0; i < argc; i++)
|
for(i = 0; i < filec; i++)
|
||||||
if(_head_do(flgn, argv[i]) != 0)
|
if(_head_do(flgn, filev[i]) != 0)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +45,7 @@ static int _head_error(char const * message, int ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _head_do(int flgn, char * filename)
|
static int _head_do(int flgn, char const * filename)
|
||||||
{
|
{
|
||||||
FILE * fp;
|
FILE * fp;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user