Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
b4afd23c
Commit
b4afd23c
authored
Jul 26, 2004
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow safe_fname() to tweak up to two name at a time.
parent
af1a3f9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
util.c
util.c
+6
-3
No files found.
util.c
View file @
b4afd23c
...
@@ -902,17 +902,20 @@ int pop_dir(char *dir)
...
@@ -902,17 +902,20 @@ int pop_dir(char *dir)
/**
/**
* Return the filename, turning any newlines into '?'s. This ensures that
* Return the filename, turning any newlines into '?'s. This ensures that
* outputting it on a line of its own cannot generate an empty line.
* outputting it on a line of its own cannot generate an empty line. This
* function can handle only 2 names at a time!
**/
**/
const
char
*
safe_fname
(
const
char
*
fname
)
const
char
*
safe_fname
(
const
char
*
fname
)
{
{
static
char
fbuf
[
MAXPATHLEN
];
static
char
fbuf1
[
MAXPATHLEN
],
fbuf2
[
MAXPATHLEN
];
static
char
*
fbuf
=
fbuf2
;
char
*
nl
=
strchr
(
fname
,
'\n'
);
char
*
nl
=
strchr
(
fname
,
'\n'
);
if
(
!
nl
)
if
(
!
nl
)
return
fname
;
return
fname
;
strlcpy
(
fbuf
,
fname
,
sizeof
fbuf
);
fbuf
=
fbuf
==
fbuf1
?
fbuf2
:
fbuf1
;
strlcpy
(
fbuf
,
fname
,
MAXPATHLEN
);
nl
=
fbuf
+
(
nl
-
(
char
*
)
fname
);
nl
=
fbuf
+
(
nl
-
(
char
*
)
fname
);
do
{
do
{
*
nl
=
'?'
;
*
nl
=
'?'
;
...
...
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