summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLogs/ChangeLog-02a10
-rw-r--r--ChangeLogs/ChangeLog-03a10
-rw-r--r--ace/SString.h10
-rw-r--r--examples/OS/Process/process.cpp9
5 files changed, 45 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 19d59c83cdb..3d5e53817f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Thu Oct 18 19:52:44 2001 Craig Rodrigues <crodrigu@bbn.com>
+
+ * ace/SString.h: clarify example in comments to ACE_Tokenize
+ so that constant strings are not passed in its constructor.
+
+ * examples/OS/Process/process.cpp: do not pass constant strings
+ to ACE_Tokenize constructor. Thanks to
+ Werner Buchert <w.buchert@medat.de> and
+ Don Hinton <dhinton@swan.fr>.
+
Wed Oct 17 23:56:45 2001 Ossama Othman <ossama@uci.edu>
* tests/Proactor_Test.cpp:
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 19d59c83cdb..3d5e53817f5 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,13 @@
+Thu Oct 18 19:52:44 2001 Craig Rodrigues <crodrigu@bbn.com>
+
+ * ace/SString.h: clarify example in comments to ACE_Tokenize
+ so that constant strings are not passed in its constructor.
+
+ * examples/OS/Process/process.cpp: do not pass constant strings
+ to ACE_Tokenize constructor. Thanks to
+ Werner Buchert <w.buchert@medat.de> and
+ Don Hinton <dhinton@swan.fr>.
+
Wed Oct 17 23:56:45 2001 Ossama Othman <ossama@uci.edu>
* tests/Proactor_Test.cpp:
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 19d59c83cdb..3d5e53817f5 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,13 @@
+Thu Oct 18 19:52:44 2001 Craig Rodrigues <crodrigu@bbn.com>
+
+ * ace/SString.h: clarify example in comments to ACE_Tokenize
+ so that constant strings are not passed in its constructor.
+
+ * examples/OS/Process/process.cpp: do not pass constant strings
+ to ACE_Tokenize constructor. Thanks to
+ Werner Buchert <w.buchert@medat.de> and
+ Don Hinton <dhinton@swan.fr>.
+
Wed Oct 17 23:56:45 2001 Ossama Othman <ossama@uci.edu>
* tests/Proactor_Test.cpp:
diff --git a/ace/SString.h b/ace/SString.h
index 9ce22c6b077..9327b386b8b 100644
--- a/ace/SString.h
+++ b/ace/SString.h
@@ -590,6 +590,9 @@ public:
* \a buffer will be parsed. Notice that ACE_Tokenizer will modify
* \a buffer if you use <code> delimiter_replace </code> or <code>
* preserve_designators </code> to do character substitution.
+ * NOTE: You should NOT pass a constant string or string literal
+ * to this constructor, since ACE_Tokenizer will try to modify
+ * the string.
* \sa preserve_designators
* \sa preserve_designators
*/
@@ -601,8 +604,11 @@ public:
*
* <B>Example:</B>
* \verbatim
- ACE_Tokenizer tok ("William/Joseph/Hagins");
- tok.delimiter ('/');
+ char buf[30];
+ ACE_OS::strcpy(buf, "William/Joseph/Hagins");
+
+ ACE_Tokenizer tok (buf);
+ tok.delimiter ('/');
for (char *p = tok.next (); p; p = tok.next ())
cout << p << endl;
\endverbatim
diff --git a/examples/OS/Process/process.cpp b/examples/OS/Process/process.cpp
index a920926ee00..8b05831a303 100644
--- a/examples/OS/Process/process.cpp
+++ b/examples/OS/Process/process.cpp
@@ -544,10 +544,15 @@ main (int argc, char *argv[])
if (print_file != 0)
test_more ();
+ char buf1[30];
+ char buf2[30];
+ ACE_OS::strcpy(buf1, " -f hi honey -g \"I\'m home\"");
+ ACE_OS::strcpy(buf2, "\"token 1\"\'token 2\'\"token 3\" ");
+
if (run_tokenizer)
{
- tokenize (" -f hi honey -g \"I\'m home\"");
- tokenize ("\"token 1\"\'token 2\'\"token 3\" ");
+ tokenize ( buf1 );
+ tokenize ( buf2 );
}
return 0;