From 8e2068180c00845891090d624017bceba317eabf Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Wed, 29 May 1996 03:27:31 +0000 Subject: [PATCH] Fix some minor formatting dreck. --- release/sysinstall/dist.c | 17 +++++++++-------- usr.sbin/sysinstall/dist.c | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c index 297483a0295e..6df410108d56 100644 --- a/release/sysinstall/dist.c +++ b/release/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.54 1996/05/28 23:31:20 jkh Exp $ + * $Id: dist.c,v 1.55 1996/05/29 01:35:26 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -474,10 +474,9 @@ distExtract(char *parent, Distribution *me) } static void -printSelected(char *buf, int selected, Distribution *me) +printSelected(char *buf, int selected, Distribution *me, int *col) { int i; - static int col = 0; /* Loop through to see if we're in our parent's plans */ for (i = 0; me[i].my_name; i++) { @@ -490,15 +489,15 @@ printSelected(char *buf, int selected, Distribution *me) if (!me[i].my_dir) continue; - col += strlen(me[i].my_name); - if (col > 50) { - col = 0; + *col += strlen(me[i].my_name); + if (*col > 50) { + *col = 0; strcat(buf, "\n"); } sprintf(&buf[strlen(buf)], " %s", me[i].my_name); /* Recurse if have a sub-distribution */ if (me[i].my_dist) - printSelected(buf, *(me[i].my_mask), me[i].my_dist); + printSelected(buf, *(me[i].my_mask), me[i].my_dist, col); } } @@ -525,8 +524,10 @@ distExtractAll(dialogMenuItem *self) distExtract(NULL, DistTable); if (Dists) { + int col = 0; + buf[0] = '\0'; - printSelected(buf, Dists, DistTable); + printSelected(buf, Dists, DistTable, &col); dialog_clear(); msgConfirm("Couldn't extract the following distributions. This may\n" "be because they were not available on the installation\n" diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index 297483a0295e..6df410108d56 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.54 1996/05/28 23:31:20 jkh Exp $ + * $Id: dist.c,v 1.55 1996/05/29 01:35:26 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -474,10 +474,9 @@ distExtract(char *parent, Distribution *me) } static void -printSelected(char *buf, int selected, Distribution *me) +printSelected(char *buf, int selected, Distribution *me, int *col) { int i; - static int col = 0; /* Loop through to see if we're in our parent's plans */ for (i = 0; me[i].my_name; i++) { @@ -490,15 +489,15 @@ printSelected(char *buf, int selected, Distribution *me) if (!me[i].my_dir) continue; - col += strlen(me[i].my_name); - if (col > 50) { - col = 0; + *col += strlen(me[i].my_name); + if (*col > 50) { + *col = 0; strcat(buf, "\n"); } sprintf(&buf[strlen(buf)], " %s", me[i].my_name); /* Recurse if have a sub-distribution */ if (me[i].my_dist) - printSelected(buf, *(me[i].my_mask), me[i].my_dist); + printSelected(buf, *(me[i].my_mask), me[i].my_dist, col); } } @@ -525,8 +524,10 @@ distExtractAll(dialogMenuItem *self) distExtract(NULL, DistTable); if (Dists) { + int col = 0; + buf[0] = '\0'; - printSelected(buf, Dists, DistTable); + printSelected(buf, Dists, DistTable, &col); dialog_clear(); msgConfirm("Couldn't extract the following distributions. This may\n" "be because they were not available on the installation\n"