summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2001-12-08 20:56:56 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2001-12-08 20:56:56 +0000
commit6579bccb3a3f22f882ef908ad5f7e1a65b00b133 (patch)
tree178eec8eac51e9b926e45ab0604242db6203a6ab
parent095bfed6418ada94b0b82799328f7c93fc8d61dc (diff)
downloadATCD-6579bccb3a3f22f882ef908ad5f7e1a65b00b133.tar.gz
ChangeLogTag:Sat Dec 8 09:39:48 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
-rw-r--r--ChangeLog36
-rw-r--r--ChangeLogs/ChangeLog-02a36
-rw-r--r--ChangeLogs/ChangeLog-03a36
-rw-r--r--ace/OS.cpp114
4 files changed, 113 insertions, 109 deletions
diff --git a/ChangeLog b/ChangeLog
index 9d4bb14f5f1..c6a729c4f21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
Sat Dec 8 09:39:48 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+ * ace/OS.cpp (string_to_argv): Improved the support for quoted strings.
+ Thanks to Kevin Burge <kevin.burge@systemware.com> for reporting
+ this.
+
* ace/Profile_Timer.cpp,
ace/OS.i,
ace/OS.h,
@@ -16,22 +20,6 @@ Fri Dec 7 07:57:12 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
simulation version of ACE_OS::cond_timedwait(). Thanks to
Michael Graf <mg@leutek.de> for helping to find this.
-Thu Dec 6 18:48:07 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
-
- * ace/Lib_Find.cpp: Fixed the ldfind() method so that it
- does a case-insensitive comparison on Windows platforms. Thanks
- to Kevin Burge <kevin.burge@systemware.com> for reporting this.
-
-Thu Dec 6 09:02:06 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
-
- * ace/Sock_Connect.cpp: Added MACOSX support. Thanks to
- John Michael Zorko <j.zorko@att.net> for contributing this.
-
- * tests/Logging_Strategy_Test.cpp: Add a "wait()" at the
- end of the main function to avoid problems when the main thread
- exits before the reactor thread. Thanks to Michael Searles
- <msearles@base16.com> for reporting this.
-
Fri Dec 07 14:28:33 2001 Carlos O'Ryan <coryan@uci.edu>
* tests/ACE_Init_Test.cpp:
@@ -62,6 +50,22 @@ Fri Dec 7 10:22:25 2001 Ossama Othman <ossama@uci.edu>
Chovanec <Vladimir.CHOVANEC@asset.sk> for tracking down this
problem.
+Thu Dec 6 18:48:07 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+
+ * ace/Lib_Find.cpp: Fixed the ldfind() method so that it
+ does a case-insensitive comparison on Windows platforms. Thanks
+ to Kevin Burge <kevin.burge@systemware.com> for reporting this.
+
+Thu Dec 6 09:02:06 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+
+ * ace/Sock_Connect.cpp: Added MACOSX support. Thanks to
+ John Michael Zorko <j.zorko@att.net> for contributing this.
+
+ * tests/Logging_Strategy_Test.cpp: Add a "wait()" at the
+ end of the main function to avoid problems when the main thread
+ exits before the reactor thread. Thanks to Michael Searles
+ <msearles@base16.com> for reporting this.
+
Thu Dec 06 20:28:02 2001 Nanbor Wang <nanbor@cs.wustl.edu>
* ace/SString.cpp (ACE_NS_WString): Char string constructor only
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 9d4bb14f5f1..c6a729c4f21 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,5 +1,9 @@
Sat Dec 8 09:39:48 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+ * ace/OS.cpp (string_to_argv): Improved the support for quoted strings.
+ Thanks to Kevin Burge <kevin.burge@systemware.com> for reporting
+ this.
+
* ace/Profile_Timer.cpp,
ace/OS.i,
ace/OS.h,
@@ -16,22 +20,6 @@ Fri Dec 7 07:57:12 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
simulation version of ACE_OS::cond_timedwait(). Thanks to
Michael Graf <mg@leutek.de> for helping to find this.
-Thu Dec 6 18:48:07 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
-
- * ace/Lib_Find.cpp: Fixed the ldfind() method so that it
- does a case-insensitive comparison on Windows platforms. Thanks
- to Kevin Burge <kevin.burge@systemware.com> for reporting this.
-
-Thu Dec 6 09:02:06 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
-
- * ace/Sock_Connect.cpp: Added MACOSX support. Thanks to
- John Michael Zorko <j.zorko@att.net> for contributing this.
-
- * tests/Logging_Strategy_Test.cpp: Add a "wait()" at the
- end of the main function to avoid problems when the main thread
- exits before the reactor thread. Thanks to Michael Searles
- <msearles@base16.com> for reporting this.
-
Fri Dec 07 14:28:33 2001 Carlos O'Ryan <coryan@uci.edu>
* tests/ACE_Init_Test.cpp:
@@ -62,6 +50,22 @@ Fri Dec 7 10:22:25 2001 Ossama Othman <ossama@uci.edu>
Chovanec <Vladimir.CHOVANEC@asset.sk> for tracking down this
problem.
+Thu Dec 6 18:48:07 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+
+ * ace/Lib_Find.cpp: Fixed the ldfind() method so that it
+ does a case-insensitive comparison on Windows platforms. Thanks
+ to Kevin Burge <kevin.burge@systemware.com> for reporting this.
+
+Thu Dec 6 09:02:06 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+
+ * ace/Sock_Connect.cpp: Added MACOSX support. Thanks to
+ John Michael Zorko <j.zorko@att.net> for contributing this.
+
+ * tests/Logging_Strategy_Test.cpp: Add a "wait()" at the
+ end of the main function to avoid problems when the main thread
+ exits before the reactor thread. Thanks to Michael Searles
+ <msearles@base16.com> for reporting this.
+
Thu Dec 06 20:28:02 2001 Nanbor Wang <nanbor@cs.wustl.edu>
* ace/SString.cpp (ACE_NS_WString): Char string constructor only
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 9d4bb14f5f1..c6a729c4f21 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,5 +1,9 @@
Sat Dec 8 09:39:48 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+ * ace/OS.cpp (string_to_argv): Improved the support for quoted strings.
+ Thanks to Kevin Burge <kevin.burge@systemware.com> for reporting
+ this.
+
* ace/Profile_Timer.cpp,
ace/OS.i,
ace/OS.h,
@@ -16,22 +20,6 @@ Fri Dec 7 07:57:12 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
simulation version of ACE_OS::cond_timedwait(). Thanks to
Michael Graf <mg@leutek.de> for helping to find this.
-Thu Dec 6 18:48:07 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
-
- * ace/Lib_Find.cpp: Fixed the ldfind() method so that it
- does a case-insensitive comparison on Windows platforms. Thanks
- to Kevin Burge <kevin.burge@systemware.com> for reporting this.
-
-Thu Dec 6 09:02:06 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
-
- * ace/Sock_Connect.cpp: Added MACOSX support. Thanks to
- John Michael Zorko <j.zorko@att.net> for contributing this.
-
- * tests/Logging_Strategy_Test.cpp: Add a "wait()" at the
- end of the main function to avoid problems when the main thread
- exits before the reactor thread. Thanks to Michael Searles
- <msearles@base16.com> for reporting this.
-
Fri Dec 07 14:28:33 2001 Carlos O'Ryan <coryan@uci.edu>
* tests/ACE_Init_Test.cpp:
@@ -62,6 +50,22 @@ Fri Dec 7 10:22:25 2001 Ossama Othman <ossama@uci.edu>
Chovanec <Vladimir.CHOVANEC@asset.sk> for tracking down this
problem.
+Thu Dec 6 18:48:07 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+
+ * ace/Lib_Find.cpp: Fixed the ldfind() method so that it
+ does a case-insensitive comparison on Windows platforms. Thanks
+ to Kevin Burge <kevin.burge@systemware.com> for reporting this.
+
+Thu Dec 6 09:02:06 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
+
+ * ace/Sock_Connect.cpp: Added MACOSX support. Thanks to
+ John Michael Zorko <j.zorko@att.net> for contributing this.
+
+ * tests/Logging_Strategy_Test.cpp: Add a "wait()" at the
+ end of the main function to avoid problems when the main thread
+ exits before the reactor thread. Thanks to Michael Searles
+ <msearles@base16.com> for reporting this.
+
Thu Dec 06 20:28:02 2001 Nanbor Wang <nanbor@cs.wustl.edu>
* ace/SString.cpp (ACE_NS_WString): Char string constructor only
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 5d9babf5367..d75c74f54c6 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -4280,32 +4280,29 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf,
if (*cp != '\0')
argc++;
- // Grok quotes....
- if (*cp == '\'' || *cp == '"')
+ while (*cp != '\0' && !ACE_OS::ace_isspace (*cp))
{
- ACE_TCHAR quote = *cp;
+ // Grok quotes....
+ if (*cp == '\'' || *cp == '"')
+ {
+ ACE_TCHAR quote = *cp;
- // Scan past the string..
- for (cp++; *cp != '\0' && *cp != quote; cp++)
- continue;
+ // Scan past the string..
+ for (cp++; *cp != '\0' && *cp != quote; cp++)
+ continue;
- // '\0' implies unmatched quote..
- if (*cp == '\0')
- {
- // The OS layer should not print stuff out.
- // In fact this functions should go into ACE_ARGV!!
- // ACE_ERROR ((LM_ERROR,
- // ACE_LIB_TEXT ("unmatched %c detected\n"),
- // quote));
- argc--;
- break;
+ // '\0' implies unmatched quote..
+ if (*cp == '\0')
+ {
+ argc--;
+ break;
+ }
+ else
+ cp++;
}
else
cp++;
}
- else // Skip over non-whitespace....
- while (*cp != '\0' && !ACE_OS::ace_isspace (*cp))
- cp++;
}
// Second pass: copy arguments.
@@ -4333,55 +4330,50 @@ ACE_OS::string_to_argv (ACE_TCHAR *buf,
ptr++;
// Copy next argument and move to next whitespace..
- if (*ptr == '\'' || *ptr == '"')
- {
- ACE_TCHAR quote = *ptr++;
-
- for (cp = argp;
- *ptr != '\0' && *ptr != quote;
- ptr++, cp++)
- {
- // @@ We can probably remove this since we ensure it's
- // big enough earlier!
- // I (coryan) removed it, using asserts in the OS layer
- // brings down the Log msg stuff
- // ACE_ASSERT (unsigned (cp - argp) < ACE_DEFAULT_ARGV_BUFSIZ);
- *cp = *ptr;
- }
+ cp = argp;
+ while (*ptr != '\0' && !ACE_OS::ace_isspace (*ptr))
+ if (*ptr == '\'' || *ptr == '"')
+ {
+ ACE_TCHAR quote = *ptr++;
+
+ while (*ptr != '\0' && *ptr != quote)
+ *cp++ = *ptr++;
- *cp = '\0';
- if (*ptr == quote)
- ptr++;
- }
- else
- {
- for (cp = arg;
- *ptr && !ACE_OS::ace_isspace (*ptr);
- ptr++, cp++)
- {
- // @@ We can probably remove this since we ensure it's
- // big enough earlier!
- // I (coryan) removed it, using asserts in the OS layer
- // brings down the Log msg stuff
- // ACE_ASSERT (u_int (cp - argp) < ACE_DEFAULT_ARGV_BUFSIZ);
- *cp = *ptr;
- }
+ if (*ptr == quote)
+ ptr++;
+ }
+ else
+ *cp++ = *ptr++;
- *cp = '\0';
- }
+ *cp = '\0';
#if !defined (ACE_LACKS_ENV)
// Check for environment variable substitution here.
- if (substitute_env_args)
- ACE_ALLOCATOR_RETURN (argv[i],
- ACE_OS::strenvdup (arg),
- -1);
+ if (substitute_env_args) {
+ argv[i] = ACE_OS::strenvdup(argp);
+
+ if (argv[i] == 0)
+ {
+ if (argp != arg)
+ delete [] argp;
+ errno = ENOMEM;
+ return -1;
+ }
+ }
else
#endif /* ACE_LACKS_ENV */
- ACE_ALLOCATOR_RETURN (argv[i],
- ACE_OS::strdup (arg),
- -1);
- }
+ {
+ argv[i] = ACE_OS::strdup(argp);
+
+ if (argv[i] == 0)
+ {
+ if (argp != arg)
+ delete [] argp;
+ errno = ENOMEM;
+ return -1;
+ }
+ }
+ }
if (argp != arg)
delete [] argp;