summaryrefslogtreecommitdiffstats
path: root/stapfuncs.3stap.in
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemyslaw@pawelczyk.it>2009-06-18 01:50:31 +0200
committerJosh Stone <jistone@redhat.com>2009-06-17 17:43:48 -0700
commit7f12f9a3f6aeb2452acedced5a54c66c4a19382b (patch)
tree491f2b5f26cc83319d43c2ef45417b446448c276 /stapfuncs.3stap.in
parent44b73c9d467fe0383d33dce5f1217e023f3b203b (diff)
downloadsystemtap-steved-7f12f9a3f6aeb2452acedced5a54c66c4a19382b.tar.gz
systemtap-steved-7f12f9a3f6aeb2452acedced5a54c66c4a19382b.tar.xz
systemtap-steved-7f12f9a3f6aeb2452acedced5a54c66c4a19382b.zip
Fix tokenize function and test.
Previous implementation was error-prone, because allowed returning empty tokens (mimiced strsep()), which is fine if there is a NULL semantic. Unfortunately SystemTap doesn't provide it in scripts and has only blank string (""), therefore testing against it was misleading. The solution is to return only non-empty tokens (mimic strtok()). * tapset/string.stp: Fix tokenize. * testsuite/systemtap.string/tokenize.stp: Improve and add case with more than one delimiter in the delim string. * testsuite/systemtap.string/tokenize.exp: Ditto. * stapfuncs.3stap.in: Update tokenize description. * doc/langref.tex: Ditto. Signed-off-by: Josh Stone <jistone@redhat.com>
Diffstat (limited to 'stapfuncs.3stap.in')
-rw-r--r--stapfuncs.3stap.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/stapfuncs.3stap.in b/stapfuncs.3stap.in
index 518ff2bb..3d88b2ea 100644
--- a/stapfuncs.3stap.in
+++ b/stapfuncs.3stap.in
@@ -166,11 +166,11 @@ specified by base. For example, strtol("1000", 16) returns 4096. Returns 0 if
string cannot be converted.
.TP
tokenize:string (str:string, delim:string)
-Return the next token in the given str string, where the tokens are delimited
-by one of the characters in the delim string. If the str string is not blank,
+Return the next non-empty token in the given str string, where the tokens are
+delimited by characters in the delim string. If the str string is not blank,
it returns the first token. If the str string is blank, it returns the next
token in the string passed in the previous call to tokenize. If no delimiter
-is found, the entire remaining str string is returned. Returns blank when
+is found, the entire remaining str string is returned. Returns blank when
no more tokens are left.
.SS TIMESTAMP