Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
418e27ea
Commit
418e27ea
authored
24 years ago
by
Ryan Cumming
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make CDROM_GetLabel return 0 in the event of failure, and make the
default label for drives a string of 11 spaces.
parent
8767ee3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
files/drive.c
+1
-1
1 addition, 1 deletion
files/drive.c
misc/cdrom.c
+5
-7
5 additions, 7 deletions
misc/cdrom.c
with
6 additions
and
8 deletions
files/drive.c
+
1
−
1
View file @
418e27ea
...
@@ -189,7 +189,7 @@ int DRIVE_Init(void)
...
@@ -189,7 +189,7 @@ int DRIVE_Init(void)
drive
->
ino
=
drive_stat_buffer
.
st_ino
;
drive
->
ino
=
drive_stat_buffer
.
st_ino
;
/* Get the drive label */
/* Get the drive label */
PROFILE_GetWineIniString
(
name
,
"Label"
,
name
,
drive
->
label_conf
,
12
);
PROFILE_GetWineIniString
(
name
,
"Label"
,
""
,
drive
->
label_conf
,
12
);
if
((
len
=
strlen
(
drive
->
label_conf
))
<
11
)
if
((
len
=
strlen
(
drive
->
label_conf
))
<
11
)
{
{
/* Pad label with spaces */
/* Pad label with spaces */
...
...
This diff is collapsed.
Click to expand it.
misc/cdrom.c
+
5
−
7
View file @
418e27ea
...
@@ -779,8 +779,6 @@ end:
...
@@ -779,8 +779,6 @@ end:
return
serial
;
return
serial
;
}
}
static
const
char
empty_label
[]
=
" "
;
/**************************************************************************
/**************************************************************************
* CDROM_Data_GetLabel [internal]
* CDROM_Data_GetLabel [internal]
*/
*/
...
@@ -822,13 +820,12 @@ DWORD CDROM_Data_GetLabel(WINE_CDAUDIO* wcda, char *label, int parentdev)
...
@@ -822,13 +820,12 @@ DWORD CDROM_Data_GetLabel(WINE_CDAUDIO* wcda, char *label, int parentdev)
strncpy
(
label
,
(
LPSTR
)
label_read
,
11
);
strncpy
(
label
,
(
LPSTR
)
label_read
,
11
);
label
[
11
]
=
'\0'
;
label
[
11
]
=
'\0'
;
}
}
return
0
;
return
1
;
}
}
}
}
failure:
failure:
CDROM_CLOSE
(
dev
,
parentdev
);
CDROM_CLOSE
(
dev
,
parentdev
);
ERR
(
"error reading label !
\n
"
);
ERR
(
"error reading label !
\n
"
);
strcpy
(
label
,
empty_label
);
return
0
;
return
0
;
}
}
...
@@ -866,22 +863,23 @@ DWORD CDROM_GetLabel(int drive, char *label)
...
@@ -866,22 +863,23 @@ DWORD CDROM_GetLabel(int drive, char *label)
/* common code *here* !! */
/* common code *here* !! */
/* hopefully a data CD */
/* hopefully a data CD */
CDROM_Data_GetLabel
(
&
wcda
,
label
,
dev
);
if
(
!
CDROM_Data_GetLabel
(
&
wcda
,
label
,
dev
))
ret
=
0
;
break
;
break
;
case
CDS_MIXED
:
case
CDS_MIXED
:
cdname
=
"Mixed mode"
;
cdname
=
"Mixed mode"
;
ERR
(
"We don't have a way of determining the label of a mixed mode CD - Linux doesn't allow raw access !!
\n
"
);
ERR
(
"We don't have a way of determining the label of a mixed mode CD - Linux doesn't allow raw access !!
\n
"
);
/* fall through */
/* fall through */
case
CDS_NO_INFO
:
case
CDS_NO_INFO
:
if
(
!
cdname
)
cdname
=
"No_info"
;
if
(
!
cdname
)
cdname
=
"No_info"
;
strcpy
(
label
,
empty_label
)
;
ret
=
0
;
break
;
break
;
default:
default:
WARN
(
"Strange CD type (%d) or empty ?
\n
"
,
media
);
WARN
(
"Strange CD type (%d) or empty ?
\n
"
,
media
);
cdname
=
"Strange/empty"
;
cdname
=
"Strange/empty"
;
strcpy
(
label
,
empty_label
);
ret
=
0
;
ret
=
0
;
break
;
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment