Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
7346893d
Commit
7346893d
authored
14 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Enum values followed by comments are now supported (enum values in keys
are now truncated at first white-space char).
parent
b61c9c2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/ini_file.c
+11
-3
11 additions, 3 deletions
src/xpdev/ini_file.c
with
11 additions
and
3 deletions
src/xpdev/ini_file.c
+
11
−
3
View file @
7346893d
...
...
@@ -1559,21 +1559,29 @@ time_t iniGetDateTime(str_list_t list, const char* section, const char* key, tim
static
unsigned
parseEnum
(
const
char
*
value
,
str_list_t
names
)
{
unsigned
i
,
count
;
char
val
[
INI_MAX_VALUE_LEN
];
char
*
p
=
val
;
/* Strip trailing words (enums must be a single word with no white-space) */
/* to support comments following enum values */
SAFECOPY
(
val
,
value
);
FIND_WHITESPACE
(
p
);
*
p
=
0
;
if
((
count
=
strListCount
(
names
))
==
0
)
return
0
;
/* Look for exact matches first */
for
(
i
=
0
;
i
<
count
;
i
++
)
if
(
stricmp
(
names
[
i
],
val
ue
)
==
0
)
if
(
stricmp
(
names
[
i
],
val
)
==
0
)
return
(
i
);
/* Look for partial matches second */
for
(
i
=
0
;
i
<
count
;
i
++
)
if
(
strnicmp
(
names
[
i
],
val
ue
,
strlen
(
val
ue
))
==
0
)
if
(
strnicmp
(
names
[
i
],
val
,
strlen
(
val
))
==
0
)
return
(
i
);
i
=
strtoul
(
val
ue
,
NULL
,
0
);
i
=
strtoul
(
val
,
NULL
,
0
);
if
(
i
>=
count
)
i
=
count
-
1
;
return
i
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment