Ticket #4602: dosfs_volume_name.diff
File dosfs_volume_name.diff, 936 bytes (added by , 15 years ago) |
---|
-
dosfs.c
994 994 dosfs_read_fs_stat(fs_volume *_vol, struct fs_info * fss) 995 995 { 996 996 nspace* vol = (nspace*)_vol->private_volume; 997 int i;998 997 999 998 LOCK_VOL(vol); 1000 999 … … 1021 1020 strncpy(fss->device_name, vol->device, sizeof(fss->device_name)); 1022 1021 1023 1022 if (vol->vol_entry > -2) 1024 str ncpy(fss->volume_name, vol->vol_label, sizeof(fss->volume_name));1023 strlcpy(fss->volume_name, vol->vol_label, sizeof(fss->volume_name)); 1025 1024 else 1026 1025 strcpy(fss->volume_name, "no name"); 1027 1026 1028 // XXX: should sanitize name as well1029 for (i=10;i>0;i--)1030 if (fss->volume_name[i] != ' ')1031 break;1032 fss->volume_name[i+1] = 0;1033 for (;i>=0;i--) {1034 if ((fss->volume_name[i] >= 'A') && (fss->volume_name[i] <= 'Z'))1035 fss->volume_name[i] += 'a' - 'A';1036 }1037 1038 1027 // File system name 1039 1028 strcpy(fss->fsh_name, "fat"); 1040 1029