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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
bc9ca699
Commit
bc9ca699
authored
Nov 10, 2006
by
ted@ted.mysql.internal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memory allocation bug fixed
parent
e9b42a4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
client/mysql_upgrade.c
client/mysql_upgrade.c
+16
-21
No files found.
client/mysql_upgrade.c
View file @
bc9ca699
...
...
@@ -386,18 +386,18 @@ find_file(const char *name, const char *root, uint flags, char *result, size_t l
cp
=
strmake
(
result
,
root
,
len
);
if
(
cp
[
-
1
]
!=
FN_LIBCHAR
)
*
cp
=
FN_LIBCHAR
;
*
cp
++
=
FN_LIBCHAR
;
ret
=
1
;
va_start
(
va
,
len
);
subdir
=
(
!
(
flags
&
MY_SEARCH_SELF
))
?
va_arg
(
va
,
char
*
)
:
""
;
while
(
ret
&&
subdir
)
while
(
subdir
)
{
MY_DIR
*
dir
;
FILEINFO
*
match
;
char
*
cp1
;
cp1
=
strnmov
(
cp
+
1
,
subdir
,
len
-
(
cp
-
result
)
-
1
);
cp1
=
strnmov
(
cp
,
subdir
,
len
-
(
cp
-
result
)
-
1
);
dir
=
my_dir
(
result
,
(
flags
&
MY_ISDIR
)
?
MY_WANT_STAT
:
MYF
(
0
));
if
(
dir
)
...
...
@@ -406,25 +406,20 @@ find_file(const char *name, const char *root, uint flags, char *result, size_t l
sizeof
(
FILEINFO
),
(
qsort_cmp
)
comp_names
);
if
(
match
)
{
if
(
!
(
flags
&
MY_PARENT
))
{
if
(
cp1
[
-
1
]
!=
FN_LIBCHAR
)
ret
=
(
flags
&
MY_ISDIR
)
?
!
MY_S_ISDIR
(
match
->
mystat
->
st_mode
)
:
0
;
if
(
!
ret
)
{
if
(
cp1
[
-
1
]
!=
FN_LIBCHAR
)
*
cp1
++=
FN_LIBCHAR
;
strnmov
(
cp1
,
name
,
len
-
(
cp1
-
result
));
}
else
{
if
(
cp1
[
-
1
]
==
FN_LIBCHAR
)
--
cp1
;
while
(
*--
cp1
==
FN_LIBCHAR
)
{}
*++
cp1
=
FN_LIBCHAR
;
*++
cp1
=
'\0'
;
if
(
!
(
flags
&
MY_PARENT
))
strnmov
(
cp1
,
name
,
len
-
(
cp1
-
result
));
else
*
cp1
=
'\0'
;
my_dirend
(
dir
);
break
;
}
if
(
flags
&
MY_ISDIR
)
ret
=
!
MY_S_ISDIR
(
match
->
mystat
->
st_mode
);
else
ret
=
0
;
}
my_dirend
(
dir
);
}
...
...
@@ -484,7 +479,7 @@ int main(int argc, char **argv)
||
find_file
(
mysqld_name
,
basedir
,
MYF
(
0
),
path
,
sizeof
(
path
),
"bin"
,
"libexec"
,
NullS
))
{
my_
strdup
((
gptr
)
basedir
,
MYF
(
0
));
my_
free
((
gptr
)
basedir
,
MYF
(
0
));
basedir
=
(
char
*
)
DEFAULT_MYSQL_HOME
;
}
}
...
...
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