1 /* vi: set sw=4 ts=4: */
3 * seq implementation for busybox
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Library General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 extern int seq_main(int argc, char **argv)
31 first = atof(argv[1]);
32 increment = atof(argv[2]);
33 } else if (argc == 3) {
34 first = atof(argv[1]);
35 } else if (argc != 2) {
38 last = atof(argv[argc - 1]);
40 /* You should note that this is pos-5.0.91 semantics, -- FK. */
41 if ((first > last) && (increment > 0)) {
45 for (i = first; ((first <= last) ? (i <= last) : (i >= last));