diff options
author | Mike Fulbright <msf@redhat.com> | 2002-08-09 03:57:59 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-08-09 03:57:59 +0000 |
commit | 6d92cd02b4ce7348a322b93eae177917de96b6f6 (patch) | |
tree | 433a5d9564c2dc65fd5a0919888cd778f6b641fc /loader | |
parent | 2f749203bbf067d02c83d28b0bc7a3828a69c58c (diff) | |
download | anaconda-6d92cd02b4ce7348a322b93eae177917de96b6f6.tar.gz anaconda-6d92cd02b4ce7348a322b93eae177917de96b6f6.tar.xz anaconda-6d92cd02b4ce7348a322b93eae177917de96b6f6.zip |
add disc id to description string
Diffstat (limited to 'loader')
-rw-r--r-- | loader/loader.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/loader/loader.c b/loader/loader.c index 688def2e9..44ea8eb1d 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -850,9 +850,42 @@ char *getReleaseDescriptorFromIso(char *file) { /* now read OS description line */ if (tmpptr) tmpptr = fgets(tmpstr, sizeof(tmpstr), f); - fclose(f); + + if (tmpptr) + descr = strdup(tmpstr); + + /* skip over arch */ if (tmpptr) - descr = tmpstr; + tmpptr = fgets(tmpstr, sizeof(tmpstr), f); + + /* now get the CD number */ + if (tmpptr) { + unsigned int len; + char *p, *newstr; + + tmpptr = fgets(tmpstr, sizeof(tmpstr), f); + + /* nuke newline from end of descr, stick number on end*/ + for (p=descr+strlen(descr); p != descr && !isspace(*p); p--); + + *p = '\0'; + len = strlen(descr) + strlen(tmpstr) + 10; + newstr = malloc(len); + strncpy(newstr, descr, len-1); + strncat(newstr, " disc ", len-1); + + /* is this a DVD or not? If disc id has commas, like */ + /* "1,2,3", its a DVD */ + if (strchr(tmpstr, ',')) + strncat(newstr, "DVD\n", len-1); + else + strncat(newstr, tmpstr, len-1); + + free(descr); + descr = newstr; + } + + fclose(f); } } |