Skip to content

Commit

Permalink
allow empty string with type=string
Browse files Browse the repository at this point in the history
  • Loading branch information
kodebach committed Sep 14, 2021
1 parent 20a8fbe commit 09aff92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/type/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The type checker plugin supports these types:
`any`, `enum`, `string`, `wstring` and `octet`.

- Checking `any` will always be successful, regardless of the content.
- `string` matches any non-empty key value.
- `string` matches any string key value.
- `octet` and `char` are equivalent to each other.
- `enum` will do enum checking as described below.
- `boolean` only allows the values `1` and `0`. See also [Normalization](#normalization).
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/type/types.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bool elektraTypeCheckWChar (const Key * key)

bool elektraTypeCheckString (const Key * key)
{
return strlen (keyString (key)) != 0;
return keyIsString (key) == 1;
}

bool elektraTypeCheckWString (const Key * key)
Expand Down

0 comments on commit 09aff92

Please sign in to comment.