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
ee34a1de
Commit
ee34a1de
authored
Sep 21, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1-ndb
parents
d3a1b97e
eda5c319
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
ndb/src/common/mgmcommon/LocalConfig.cpp
ndb/src/common/mgmcommon/LocalConfig.cpp
+24
-22
No files found.
ndb/src/common/mgmcommon/LocalConfig.cpp
View file @
ee34a1de
...
@@ -229,7 +229,7 @@ LocalConfig::parseString(const char * connectString, char *line){
...
@@ -229,7 +229,7 @@ LocalConfig::parseString(const char * connectString, char *line){
bool
LocalConfig
::
readFile
(
const
char
*
filename
,
bool
&
fopenError
)
bool
LocalConfig
::
readFile
(
const
char
*
filename
,
bool
&
fopenError
)
{
{
char
line
[
1
50
],
line2
[
150
];
char
line
[
1
024
];
fopenError
=
false
;
fopenError
=
false
;
...
@@ -241,31 +241,33 @@ bool LocalConfig::readFile(const char * filename, bool &fopenError)
...
@@ -241,31 +241,33 @@ bool LocalConfig::readFile(const char * filename, bool &fopenError)
return
false
;
return
false
;
}
}
unsigned
int
sz
=
1024
;
BaseString
theString
;
char
*
theString
=
(
char
*
)
NdbMem_Allocate
(
sz
);
theString
[
0
]
=
0
;
while
(
fgets
(
line
,
1024
,
file
)){
BaseString
tmp
(
line
);
fgets
(
theString
,
sz
,
file
);
tmp
.
trim
(
"
\t\n\r
"
);
while
(
fgets
(
line
+
1
,
100
,
file
))
{
if
(
tmp
.
length
()
>
0
&&
tmp
.
c_str
()[
0
]
!=
'#'
){
line
[
0
]
=
';'
;
theString
.
append
(
tmp
);
while
(
strlen
(
theString
)
+
strlen
(
line
)
>=
sz
)
{
break
;
sz
=
sz
*
2
;
}
char
*
newString
=
(
char
*
)
NdbMem_Allocate
(
sz
);
}
strcpy
(
newString
,
theString
);
while
(
fgets
(
line
,
1024
,
file
))
{
free
(
theString
);
BaseString
tmp
(
line
);
theString
=
newString
;
tmp
.
trim
(
"
\t\n\r
"
);
if
(
tmp
.
length
()
>
0
&&
tmp
.
c_str
()[
0
]
!=
'#'
){
theString
.
append
(
";"
);
theString
.
append
(
tmp
);
}
}
strcat
(
theString
,
line
);
}
}
bool
return_value
=
parseString
(
theString
,
line
);
bool
return_value
=
parseString
(
theString
.
c_str
()
,
line
);
if
(
!
return_value
)
{
if
(
!
return_value
)
{
snprintf
(
line2
,
150
,
"Reading %s: %s"
,
filename
,
line
);
BaseString
tmp
;
setError
(
0
,
line2
);
tmp
.
assfmt
(
"Reading %s: %s"
,
filename
,
line
);
setError
(
0
,
tmp
.
c_str
());
}
}
free
(
theString
);
fclose
(
file
);
fclose
(
file
);
return
return_value
;
return
return_value
;
}
}
...
...
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