Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
7e44fa82
Commit
7e44fa82
authored
Apr 04, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filename_sanitize: spaces are forbidden only when beginning and ending.
parent
4638fd98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
src/text/strings.c
src/text/strings.c
+18
-1
No files found.
src/text/strings.c
View file @
7e44fa82
...
...
@@ -1034,6 +1034,12 @@ char* filename_sanitize( const char *str_origin )
return
str_base
;
}
#if defined( WIN32 )
// Change leading spaces into underscores
while
(
*
str
&&
*
str
==
' '
)
*
str
++
=
'_'
;
#endif
while
(
*
str
)
{
switch
(
*
str
)
...
...
@@ -1050,12 +1056,23 @@ char* filename_sanitize( const char *str_origin )
case
'|'
:
case
'<'
:
case
'>'
:
case
' '
:
#endif
*
str
=
'_'
;
}
str
++
;
}
#if defined( WIN32 )
// Change trailing spaces into underscores
str
--
;
while
(
str
!=
str_base
)
{
if
(
*
str
!=
' '
)
break
;
*
str
--
=
'_'
;
}
#endif
return
str_base
;
}
...
...
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