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
e0391f81
Commit
e0391f81
authored
Feb 11, 2004
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added backup_dir_buf and backup_dir_remainder.
parent
7de2483f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
options.c
options.c
+17
-4
No files found.
options.c
View file @
e0391f81
...
...
@@ -108,6 +108,7 @@ int write_batch = 0;
int
read_batch
=
0
;
int
backup_dir_len
=
0
;
int
backup_suffix_len
;
unsigned
int
backup_dir_remainder
;
char
*
backup_suffix
=
NULL
;
char
*
tmpdir
=
NULL
;
...
...
@@ -118,6 +119,7 @@ char *log_format = NULL;
char
*
password_file
=
NULL
;
char
*
rsync_path
=
RSYNC_PATH
;
char
*
backup_dir
=
NULL
;
char
backup_dir_buf
[
MAXPATHLEN
];
int
rsync_port
=
RSYNC_PORT
;
int
link_dest
=
0
;
...
...
@@ -646,16 +648,27 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
relative_paths
=
files_from
?
1
:
0
;
if
(
!
backup_suffix
)
backup_suffix
=
backup_dir
?
""
:
BACKUP_SUFFIX
;
backup_suffix
=
backup_dir
?
""
:
BACKUP_SUFFIX
;
backup_suffix_len
=
strlen
(
backup_suffix
);
if
(
strchr
(
backup_suffix
,
'/'
)
!=
NULL
)
{
rprintf
(
FERROR
,
"--suffix cannot contain slashes: %s
\n
"
,
backup_suffix
);
exit_cleanup
(
RERR_SYNTAX
);
}
if
(
backup_dir
)
backup_dir_len
=
strlen
(
backup_dir
);
else
if
(
!
backup_suffix_len
)
{
if
(
backup_dir
)
{
backup_dir_len
=
strlcpy
(
backup_dir_buf
,
backup_dir
,
sizeof
backup_dir_buf
);
backup_dir_remainder
=
sizeof
backup_dir_buf
-
backup_dir_len
;
if
(
backup_dir_remainder
<
32
)
{
rprintf
(
FERROR
,
"the --backup-dir path is WAY too long.
\n
"
);
exit_cleanup
(
RERR_SYNTAX
);
}
if
(
backup_dir_buf
[
backup_dir_len
-
1
]
!=
'/'
)
{
backup_dir_buf
[
backup_dir_len
++
]
=
'/'
;
backup_dir_buf
[
backup_dir_len
]
=
'\0'
;
}
if
(
verbose
>
1
)
rprintf
(
FINFO
,
"backup_dir is %s
\n
"
,
backup_dir_buf
);
}
else
if
(
!
backup_suffix_len
)
{
rprintf
(
FERROR
,
"--suffix cannot be a null string without --backup-dir
\n
"
);
exit_cleanup
(
RERR_SYNTAX
);
...
...
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