Page MenuHomePhabricator

eina: add eina_slstr_copy_new_length.
ClosedPublic

Authored by cedric on May 1 2019, 6:05 PM.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cedric created this revision.May 1 2019, 6:05 PM
cedric requested review of this revision.May 1 2019, 6:05 PM
segfaultxavi requested changes to this revision.May 2 2019, 5:01 AM
segfaultxavi added inline comments.
src/lib/eina/eina_slstr.h
65

Example method name does not match actual method name :D

This revision now requires changes to proceed.May 2 2019, 5:01 AM
cedric planned changes to this revision.May 2 2019, 9:16 AM

Oops.

cedric updated this revision to Diff 21896.May 2 2019, 9:41 AM

Rebase and fix example.

segfaultxavi resigned from this revision.May 2 2019, 10:23 AM

No further concerns. The code looks OK but this is the first time I come across eina short-lived strings so it'll be for the best if somebody else reviews it.

bu5hm4n accepted this revision.May 11 2019, 11:36 PM
This revision is now accepted and ready to land.May 11 2019, 11:36 PM
zmike requested changes to this revision.May 23 2019, 6:30 AM

Needs unit test(s).

This revision now requires changes to proceed.May 23 2019, 6:30 AM
cedric updated this revision to Diff 22416.May 23 2019, 5:31 PM

Rebase.

zmike requested changes to this revision.May 24 2019, 7:25 AM

Rebasing won't get you out of it.

This revision now requires changes to proceed.May 24 2019, 7:25 AM
In D8800#164974, @zmike wrote:

Rebasing won't get you out of it.

There is a test in D9016 :-)

zmike added a comment.May 24 2019, 9:33 AM

I'd like to see explicit handling for a 0 length string (i.e., immediately return null).

zmike requested changes to this revision.May 24 2019, 11:28 AM
This revision now requires changes to proceed.May 24 2019, 11:28 AM
In D8800#164993, @zmike wrote:

I'd like to see explicit handling for a 0 length string (i.e., immediately return null).

Actually this lead to ugly code. 0 length is not going to be returning null as by symmetry to strndup, we would only return NULL if the string is NULL. Otherwise we should return a valid empty string. So I don't think this is a good idea to implement. Leaning on strndup simplify the code and guarantee behavior to properly match user expectation.

zmike accepted this revision.May 29 2019, 10:49 AM

Hm ok.

This revision is now accepted and ready to land.May 29 2019, 10:49 AM
This revision was automatically updated to reflect the committed changes.