Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
04405042
Commit
04405042
authored
Dec 03, 2006
by
Marian Durkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement shell-style escaping also for double quotes and fix bugs.
parent
c1acae62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
src/input/vlm.c
src/input/vlm.c
+16
-17
No files found.
src/input/vlm.c
View file @
04405042
...
...
@@ -257,27 +257,29 @@ static const char quotes[] = "\"'";
/**
* FindCommandEnd: look for the end of a possibly quoted string
* @return NULL on mal-formatted string,
* pointer past
e
the last character otherwise.
* pointer past the last character otherwise.
*/
static
const
char
*
FindCommandEnd
(
const
char
*
psz_sent
)
{
const
char
quote
=
strchr
(
quotes
,
psz_sent
[
0
])
?
psz_sent
[
0
]
:
0
;
char
c
;
if
(
quote
)
psz_sent
++
;
// skip opening quote
while
((
c
=
*
psz_sent
)
!=
'\0'
)
{
if
((
quote
==
'"'
)
&&
(
c
==
'\\'
))
{
psz_sent
++
;
// move past backslash
if
(
*
psz_sent
==
'\0'
)
return
NULL
;
// cannot escape "nothing"
psz_sent
++
;
// skips escaped character
}
else
if
(
c
==
quote
)
// non-escaped matching quote
return
psz_sent
+
1
;
else
if
(
isblank
(
c
))
// non-escaped blank
if
(
(
!
quote
)
&&
isspace
(
c
))
// non-escaped blank
return
psz_sent
;
psz_sent
++
;
...
...
@@ -315,23 +317,20 @@ static int Unescape (char *out, const char *in)
{
switch
(
c
=
*
in
++
)
{
case
'
n
'
:
*
out
++
=
'
\n
'
;
case
'
"
'
:
*
out
++
=
'
"
'
;
continue
;
case
'
t
'
:
*
out
++
=
'\
t
'
;
case
'
\\
'
:
*
out
++
=
'\
\
'
;
continue
;
case
'
r'
:
*
out
++
=
'\r
'
;
continue
;
case
'
\0'
:
// should never happen
*
out
=
'\0
'
;
return
-
1
;
}
// Only allow printable ASCII characters
// (in particular, no nul nor extended characters)
if
(
c
<
32
)
return
-
1
;
/* None of the special cases - copy the backslash */
*
out
++
=
'\\'
;
}
*
out
++
=
c
;
}
...
...
@@ -359,7 +358,7 @@ static int ExecuteCommand( vlm_t *p_vlm, const char *psz_command,
{
const
char
*
psz_temp
;
if
(
is
blank
(
*
psz_command
))
if
(
is
space
(
*
psz_command
))
{
psz_command
++
;
continue
;
...
...
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