*
* Original copyright notice is retained at the end of this file.
*
- * Modified for BusyBox by Erik Andersen <andersee@debian.org>
+ * Modified for BusyBox by Erik Andersen <andersen@codepoet.org>
* Badly hacked by Tito Ragusa <farmatito@tiscali.it>
*/
opt+=2;
break;
case 'n':
- n = bb_xgetlarg(optarg, 1, LONG_MAX, 10);
+ n = bb_xgetlarg(optarg, 10, 1, INT_MAX);
break;
default:
- show_usage();
+ bb_show_usage();
}
argc -= optind;
pipe:
count=0;
- do
- {
+ do{
c=fgetc(file);
if(ISSTR(c))
{
else
{
if(i>n)
- puts("");
+ putchar('\n');
i=0;
}
count++;
- }
- while(c!=EOF);
+ }while(c!=EOF);
- if(file!=stdin)
- fclose(file);
+ bb_fclose_nonstdin(file);
}
else
{
- perror_msg("%s",argv[a]);
+ bb_perror_msg("%s",argv[a]);
status=EXIT_FAILURE;
}
}