Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
nexedi
MariaDB
Commits
7acccd81
Commit
7acccd81
authored
Feb 19, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
srv_add_path_separator_if_needed: be static; use memcpy, not sprintf
parent
ec06c782
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
25 deletions
+10
-25
innobase/include/srv0start.h
innobase/include/srv0start.h
+0
-10
innobase/srv/srv0start.c
innobase/srv/srv0start.c
+10
-15
No files found.
innobase/include/srv0start.h
View file @
7acccd81
...
@@ -20,16 +20,6 @@ srv_normalize_path_for_win(
...
@@ -20,16 +20,6 @@ srv_normalize_path_for_win(
/*=======================*/
/*=======================*/
char
*
str
);
/* in/out: null-terminated character string */
char
*
str
);
/* in/out: null-terminated character string */
/*************************************************************************
/*************************************************************************
Adds a slash or a backslash to the end of a string if it is missing
and the string is not empty. */
char
*
srv_add_path_separator_if_needed
(
/*=============================*/
/* out, own: string which has the separator if the
string is not empty */
char
*
str
);
/* in: null-terminated character string */
/*************************************************************************
Reads the data files and their sizes from a character string given in
Reads the data files and their sizes from a character string given in
the .cnf file. */
the .cnf file. */
...
...
innobase/srv/srv0start.c
View file @
7acccd81
...
@@ -441,9 +441,9 @@ io_handler_thread(
...
@@ -441,9 +441,9 @@ io_handler_thread(
}
}
#ifdef __WIN__
#ifdef __WIN__
#define SRV_PATH_SEPARATOR
"\\"
#define SRV_PATH_SEPARATOR
'\\'
#else
#else
#define SRV_PATH_SEPARATOR
"/"
#define SRV_PATH_SEPARATOR
'/'
#endif
#endif
/*************************************************************************
/*************************************************************************
...
@@ -470,31 +470,26 @@ srv_normalize_path_for_win(
...
@@ -470,31 +470,26 @@ srv_normalize_path_for_win(
Adds a slash or a backslash to the end of a string if it is missing
Adds a slash or a backslash to the end of a string if it is missing
and the string is not empty. */
and the string is not empty. */
static
char
*
char
*
srv_add_path_separator_if_needed
(
srv_add_path_separator_if_needed
(
/*=============================*/
/*=============================*/
/* out
, own
: string which has the separator if the
/* out: string which has the separator if the
string is not empty */
string is not empty */
char
*
str
)
/* in: null-terminated character string */
char
*
str
)
/* in: null-terminated character string */
{
{
char
*
out_str
;
char
*
out_str
;
ulint
len
=
ut_strlen
(
str
);
if
(
ut_strlen
(
str
)
==
0
)
{
if
(
len
==
0
||
str
[
len
-
1
]
==
SRV_PATH_SEPARATOR
)
{
return
(
str
);
return
(
str
);
}
}
if
(
str
[
ut_strlen
(
str
)
-
1
]
==
SRV_PATH_SEPARATOR
[
0
])
{
out_str
=
ut_malloc
(
len
+
2
);
out_str
=
ut_malloc
(
ut_strlen
(
str
)
+
1
);
memcpy
(
out_str
,
str
,
len
);
out_str
[
len
]
=
SRV_PATH_SEPARATOR
;
sprintf
(
out_str
,
"%s"
,
str
);
out_str
[
len
+
1
]
=
0
;
return
(
out_str
);
}
out_str
=
ut_malloc
(
ut_strlen
(
str
)
+
2
);
sprintf
(
out_str
,
"%s%s"
,
str
,
SRV_PATH_SEPARATOR
);
return
(
out_str
);
return
(
out_str
);
}
}
...
...
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