Roland Mainz
2012-07-24 14:13:46 UTC
Hi!
----
Attached (as "astksh_stpcpy.diff") is a small patch which adds
|stpcpy()| and |stpncpy()| to libast (if the system doesn't provide
them).
IMO it would be nice to put this _both_ into the ksh93u+ and ksh93v-
trees... risk should be very small (except there is a platform which
doesn't have |strnlen()|).
----
Bye,
Roland
P.S.: ast-open needs a purge of cases where |strcat()| is used
multiple times in sequence, cases of |sprintf(buf, "%s%s", ...)| etc.
etc. and have these abdominations all replaced by |stpcpy()| (because
it's faster&&more efficient, e.g. |strcat(buf, "aaa"); strcat(buf,
"bbb");| can be replaced with |char *s=buf; s=stpcpy(s, "aaa");
s=stpcpy(s, "bbb");| ... this will be faster because |strcat()| always
starts from the beginning of the buffer and then searches for the end
while |stpcpy()| allows an application to always continue immediately
where the old string ended).
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: astksh_stpcpy.diff
Type: text/x-patch
Size: 16492 bytes
Desc: not available
URL: <https://mailman.research.att.com/pipermail/ast-developers/attachments/20120724/b560d8e2/attachment.bin>
----
Attached (as "astksh_stpcpy.diff") is a small patch which adds
|stpcpy()| and |stpncpy()| to libast (if the system doesn't provide
them).
IMO it would be nice to put this _both_ into the ksh93u+ and ksh93v-
trees... risk should be very small (except there is a platform which
doesn't have |strnlen()|).
----
Bye,
Roland
P.S.: ast-open needs a purge of cases where |strcat()| is used
multiple times in sequence, cases of |sprintf(buf, "%s%s", ...)| etc.
etc. and have these abdominations all replaced by |stpcpy()| (because
it's faster&&more efficient, e.g. |strcat(buf, "aaa"); strcat(buf,
"bbb");| can be replaced with |char *s=buf; s=stpcpy(s, "aaa");
s=stpcpy(s, "bbb");| ... this will be faster because |strcat()| always
starts from the beginning of the buffer and then searches for the end
while |stpcpy()| allows an application to always continue immediately
where the old string ended).
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: astksh_stpcpy.diff
Type: text/x-patch
Size: 16492 bytes
Desc: not available
URL: <https://mailman.research.att.com/pipermail/ast-developers/attachments/20120724/b560d8e2/attachment.bin>