New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ini: use elektra provided strcasecmp #2093

Open
ingwinlu opened this Issue Jun 17, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@ingwinlu
Contributor

ingwinlu commented Jun 17, 2018

@ingwinlu ingwinlu changed the title from ini: use eletra provided strcasecmp to ini: use elektra provided strcasecmp Jun 17, 2018

@ingwinlu

This comment has been minimized.

Contributor

ingwinlu commented Jun 17, 2018

if you search for strcasecmp other offenders are visible as well.

@markus2330

This comment has been minimized.

Contributor

markus2330 commented Jun 17, 2018

Yes, for other functions you are completely right.

But I am consider to remove elektraStrCaseCmp from the core (see doc/todo/FUTURE), the benefit of case-insensitive searches are marginal. It is more historic that we have it.

So it is okay if plugins do not use it.

@ingwinlu

This comment has been minimized.

Contributor

ingwinlu commented Jun 18, 2018

Actually a lot of plugins are not c99 conformant because they rely on strdup and similar. So if Elektra would provide an alternative implementation (if not provided by libc) they would easily be made c99.

@markus2330

This comment has been minimized.

Contributor

markus2330 commented Jun 18, 2018

Which plugins are you referring to?

Elektra provides elektraStrDup and if we hit a system that does not have strdup we would reimplement it (but even mingw seems to have it).

strdup and strcasecmp are, however, quite different things. strdup is about memory management, which is centralized in Elektra. Somewhere needs the line to be drawn. I do not think it is useful to wrap libc.

@ingwinlu

This comment has been minimized.

Contributor

ingwinlu commented Jun 18, 2018

Which plugins are you referring to?

pick one from https://github.com/ElektraInitiative/libelektra/pull/2095/commits
for example glob.

Elektra provides elektraStrDup

then a lot of plugins do not use it

and if we hit a system that does not have strdup we would reimplement it

That is not the current behaviour, seems to be always implemented.

(but even mingw seems to have it).

It might not get exported as soon as you use c99 (as it is not c99 anymore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment