diff --git a/usr.bin/sort/msort.c b/usr.bin/sort/msort.c index 8a2500cc35d2..2d5597ca5af8 100644 --- a/usr.bin/sort/msort.c +++ b/usr.bin/sort/msort.c @@ -1,4 +1,4 @@ -/* $NetBSD: msort.c,v 1.10 2001/02/19 20:50:17 jdolecek Exp $ */ +/* $NetBSD: msort.c,v 1.11 2002/12/25 21:19:15 jdolecek Exp $ */ /*- * Copyright (c) 1993 @@ -40,7 +40,7 @@ #include "fsort.h" #ifndef lint -__RCSID("$NetBSD: msort.c,v 1.10 2001/02/19 20:50:17 jdolecek Exp $"); +__RCSID("$NetBSD: msort.c,v 1.11 2002/12/25 21:19:15 jdolecek Exp $"); __SCCSID("@(#)msort.c 8.1 (Berkeley) 6/6/93"); #endif /* not lint */ @@ -61,6 +61,7 @@ static u_char *wts, *wts1 = NULL; static int cmp __P((RECHEADER *, RECHEADER *)); static int insert __P((struct mfile **, struct mfile **, int, int)); +static void merge(int, int, get_func_t, FILE *, put_func_t, struct field *); void fmerge(binno, top, filelist, nfiles, get, outfp, fput, ftbl) @@ -133,7 +134,7 @@ fmerge(binno, top, filelist, nfiles, get, outfp, fput, ftbl) } } -void +static void merge(infl0, nfiles, get, outfp, put, ftbl) int infl0, nfiles; get_func_t get; @@ -163,7 +164,7 @@ merge(infl0, nfiles, get, outfp, put, ftbl) bufs_sz[i] = DEFLLEN; } - for (i = j = 0; i < nfiles; i++) { + for (i = j = 0; i < nfiles; i++, j++) { cfile = (struct mfile *) bufs[j]; cfile->flno = infl0 + j; cfile->end = (u_char *) bufs[j] + bufs_sz[j]; @@ -193,7 +194,6 @@ merge(infl0, nfiles, get, outfp, put, ftbl) else flist[0] = cfile; } - j++; } cfile = (struct mfile *) bufs[nf]; diff --git a/usr.bin/sort/sort.h b/usr.bin/sort/sort.h index ca38e3f2be01..493fcd1f6d23 100644 --- a/usr.bin/sort/sort.h +++ b/usr.bin/sort/sort.h @@ -1,4 +1,4 @@ -/* $NetBSD: sort.h,v 1.14 2002/12/24 15:02:46 jdolecek Exp $ */ +/* $NetBSD: sort.h,v 1.15 2002/12/25 21:19:15 jdolecek Exp $ */ /*- * Copyright (c) 1993 @@ -166,7 +166,6 @@ int makekey(int, int, struct filelist *, int, RECHEADER *, u_char *, struct field *); int makeline(int, int, struct filelist *, int, RECHEADER *, u_char *, struct field *); -void merge(int, int, get_func_t, FILE *, put_func_t, struct field *); void num_init(void); void onepass(const u_char **, int, long, long *, u_char *, FILE *); int optval(int, int);