Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
5885e88a
Commit
5885e88a
authored
Jun 04, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oldrc: fix reading from standard input
parent
bd6ddfdd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
modules/control/oldrc.c
modules/control/oldrc.c
+23
-24
No files found.
modules/control/oldrc.c
View file @
5885e88a
...
...
@@ -1851,8 +1851,6 @@ static bool ReadWin32( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
bool
ReadCommand
(
intf_thread_t
*
p_intf
,
char
*
p_buffer
,
int
*
pi_size
)
{
int
i_read
=
0
;
#ifdef _WIN32
if
(
p_intf
->
p_sys
->
i_socket
==
-
1
&&
!
p_intf
->
p_sys
->
b_quiet
)
return
ReadWin32
(
p_intf
,
p_buffer
,
pi_size
);
...
...
@@ -1863,34 +1861,35 @@ bool ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
}
#endif
while
(
*
pi_size
<
MAX_LINE_LENGTH
&&
(
i_read
=
net_Read
(
p_intf
,
p_intf
->
p_sys
->
i_socket
==
-
1
?
0
/*STDIN_FILENO*/
:
p_intf
->
p_sys
->
i_socket
,
(
uint8_t
*
)
p_buffer
+
*
pi_size
,
1
,
false
)
)
>
0
)
{
if
(
p_buffer
[
*
pi_size
]
==
'\r'
||
p_buffer
[
*
pi_size
]
==
'\n'
)
break
;
(
*
pi_size
)
++
;
}
/* Connection closed */
if
(
i_read
<=
0
)
while
(
*
pi_size
<
MAX_LINE_LENGTH
)
{
if
(
p_intf
->
p_sys
->
i_socket
!
=
-
1
)
if
(
p_intf
->
p_sys
->
i_socket
=
=
-
1
)
{
net_Close
(
p_intf
->
p_sys
->
i_socket
);
p_intf
->
p_sys
->
i_socket
=
-
1
;
if
(
read
(
0
/*STDIN_FILENO*/
,
p_buffer
+
*
pi_size
,
1
)
<=
0
)
{
/* Standard input closed: exit */
vlc_value_t
empty
;
Quit
(
VLC_OBJECT
(
p_intf
),
NULL
,
empty
,
empty
,
NULL
);
p_buffer
[
*
pi_size
]
=
0
;
return
true
;
}
}
else
{
/* Connection closed */
if
(
net_Read
(
p_intf
,
p_intf
->
p_sys
->
i_socket
,
p_buffer
+
*
pi_size
,
1
,
false
)
<=
0
)
{
/* Standard input closed: exit */
vlc_value_t
empty
;
Quit
(
VLC_OBJECT
(
p_intf
),
NULL
,
empty
,
empty
,
NULL
);
net_Close
(
p_intf
->
p_sys
->
i_socket
);
p_intf
->
p_sys
->
i_socket
=
-
1
;
p_buffer
[
*
pi_size
]
=
0
;
return
true
;
}
}
p_buffer
[
*
pi_size
]
=
0
;
return
true
;
if
(
p_buffer
[
*
pi_size
]
==
'\r'
||
p_buffer
[
*
pi_size
]
==
'\n'
)
break
;
(
*
pi_size
)
++
;
}
if
(
*
pi_size
==
MAX_LINE_LENGTH
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment