From owner-cvs-user Sat Nov 4 11:18:01 1995 Return-Path: owner-cvs-user Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA19459 for cvs-user-outgoing; Sat, 4 Nov 1995 11:18:01 -0800 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA19449 ; Sat, 4 Nov 1995 11:17:53 -0800 Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id UAA01997; Sat, 4 Nov 1995 20:17:37 +0100 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id UAA05585; Sat, 4 Nov 1995 20:17:36 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.6.12/8.6.9) id TAA02420; Sat, 4 Nov 1995 19:03:51 +0100 From: J Wunsch Message-Id: <199511041803.TAA02420@uriah.heep.sax.de> Subject: Re: cvs commit: src/release/sysinstall command.c config.c disks.c label.c sysinstall.h To: jkh@freefall.freebsd.org (Jordan K. Hubbard) Date: Sat, 4 Nov 1995 19:03:50 +0100 (MET) Cc: CVS-commiters@freefall.freebsd.org, cvs-user@freefall.freebsd.org Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199511041545.HAA28940@freefall.freebsd.org> from "Jordan K. Hubbard" at Nov 4, 95 07:45:33 am X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1210 Sender: owner-cvs-user@FreeBSD.org Precedence: bulk As Jordan K. Hubbard wrote: > > Log: > Avoid doing disk selection twice in novice install. > Finally sort the fstab file entries correctly! qsort() either > doesn't work or isn't working as documented. qsort() usage is somewhat obfuscated: j@uriah 222% cat foo.c #include #include #include const char *text[] = { "foo", "bar", "mumble", "murx", "junk", "rubbish", "trash", "bin", "junkpointer" }; int compar(const void *a, const void *b) { return strcmp((const char *)*((const char **)a), (const char *)*((const char **)b)); } int main(void) { const char **cp; int i; qsort(text, sizeof text / sizeof(const char *), sizeof(const char *), compar); for(cp = text, i = 0; i < sizeof text / sizeof(const char *); cp++, i++) printf("%s\n", *cp); return 0; } j@uriah 223% cc -Wall foo.c j@uriah 224% ./a.out bar bin foo junk junkpointer mumble murx rubbish trash -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)