summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-02-06 17:12:12 +0000
committerJeremy Katz <katzj@redhat.com>2003-02-06 17:12:12 +0000
commita182794f29c6c74c39aac70675599b997286dd52 (patch)
treea521990be0385194b71154bf82b0eade2cdd2f1f /loader2
parent6e940104030c6a7fcc92119a600230cabf0b5a88 (diff)
downloadanaconda-a182794f29c6c74c39aac70675599b997286dd52.tar.gz
anaconda-a182794f29c6c74c39aac70675599b997286dd52.tar.xz
anaconda-a182794f29c6c74c39aac70675599b997286dd52.zip
list drivers manually loaded in the list (#83624)
Diffstat (limited to 'loader2')
-rw-r--r--loader2/loader.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/loader2/loader.c b/loader2/loader.c
index 85f8969d6..99a30b827 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -794,37 +794,43 @@ static int manualDeviceCheck(moduleInfoSet modInfo, moduleList modLoaded,
int width = 40;
char * buf;
- devices = malloc((modLoaded->numModules + 1) * sizeof(*devices));
- for (i = 0, j = 0; i < modLoaded->numModules; i++) {
- if (!modLoaded->mods[i].weLoaded) continue;
-
- if (!(mi = findModuleInfo(modInfo, modLoaded->mods[i].name)) ||
- (!mi->description))
- continue;
+ do {
+ devices = malloc((modLoaded->numModules + 1) * sizeof(*devices));
+ for (i = 0, j = 0; i < modLoaded->numModules; i++) {
+ if (!modLoaded->mods[i].weLoaded) continue;
+
+ if (!(mi = findModuleInfo(modInfo, modLoaded->mods[i].name)) ||
+ (!mi->description))
+ continue;
- devices[j] = sdupprintf("%s (%s)", mi->description,
- modLoaded->mods[i].name);
- if (strlen(devices[j]) > width)
- width = strlen(devices[j]);
- j++;
- }
+ devices[j] = sdupprintf("%s (%s)", mi->description,
+ modLoaded->mods[i].name);
+ if (strlen(devices[j]) > width)
+ width = strlen(devices[j]);
+ j++;
+ }
- devices[j] = NULL;
+ devices[j] = NULL;
- if (width > 70)
- width = 70;
+ if (width > 70)
+ width = 70;
- if (j > 0) {
- buf = _("The following devices have been found on your system.");
- } else {
- buf = _("No device drivers have been loaded for your system. Would "
- "you like to load any now?");
- }
+ if (j > 0) {
+ buf = _("The following devices have been found on your system.");
+ } else {
+ buf = _("No device drivers have been loaded for your system. "
+ "Would you like to load any now?");
+ }
- do {
rc = newtWinMenu(_("Devices"), buf, width, 10, 20,
(j > 6) ? 6 : j, devices, &num, _("Done"),
_("Add Device"), NULL);
+
+ /* no leaky */
+ for (i = 0; i < j; i++)
+ free(devices[j]);
+ free(devices);
+
if (rc != 2)
break;