Skip to content
Permalink
Browse files

Read label also from rootdir entry.

See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4
for more information.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
  • Loading branch information...
pgajdos authored and daniel-baumann committed Mar 1, 2013
1 parent 5cec53c commit 5e265c42aab04a906f2dd8a570c5c26519860cb4
Showing with 10 additions and 2 deletions.
  1. +1 −1 src/boot.c
  2. +1 −0 src/boot.h
  3. +8 −1 src/dosfslabel.c
@@ -497,7 +497,7 @@ static void write_boot_label(DOS_FS * fs, char *label)
fs_write(fs->backupboot_start, sizeof(b), &b);
}

static loff_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
loff_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
{
unsigned long cluster;
loff_t offset;
@@ -25,6 +25,7 @@

void read_boot(DOS_FS * fs);
void write_label(DOS_FS * fs, char *label);
loff_t find_volume_de(DOS_FS *fs, DIR_ENT *de);

/* Reads the boot sector from the currently open device and initializes *FS */

@@ -89,6 +89,9 @@ int main(int argc, char *argv[])
char *device = NULL;
char *label = NULL;

loff_t offset;
DIR_ENT de;

check_atari();

if (argc < 2 || argc > 3)
@@ -117,7 +120,11 @@ int main(int argc, char *argv[])
if (fs.fat_bits == 32)
read_fat(&fs);
if (!rw) {
fprintf(stdout, "%s\n", fs.label);
offset = find_volume_de(&fs, &de);
if (offset == 0)
fprintf(stdout, "%s\n", fs.label);
else
fprintf(stdout, "%.8s%.3s\n", de.name, de.ext);
exit(0);
}

0 comments on commit 5e265c4

Please sign in to comment.
You can’t perform that action at this time.