Custom Query (245 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (4 - 6 of 245)

1 2 3 4 5 6 7 8 9 10 11 12
Ticket Resolution Summary Owner Reporter
#5 wontfix @response handling incomplete bird Yuri Dario
Description

response file handling has problems: doesn't accept long lines, does not support multiple args per line, doesn't remove white spaces.

This is a partial fix

Index: lib/misc/response.c
===================================================================
RCS file: /netlabs.cvs/libc/src/emx/src/lib/misc/response.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 response.c
--- lib/misc/response.c	2004/06/08 12:03:44	1.1.1.1
+++ lib/misc/response.c	2005/10/24 14:56:24
@@ -1,6 +1,7 @@
 /* response.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */
 
 #include "libc-alias.h"
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -23,7 +24,7 @@
 {
   int i, old_argc, new_argc, new_alloc;
   char **old_argv, **new_argv;
-  char line[1+512], *p;
+  char line[1+8192], *p;
   FILE *f;
 
   old_argc = *argcp; old_argv = *argvp;
@@ -47,12 +48,29 @@
           line[0] = _ARG_NONZERO|_ARG_RESPONSE;
           while (fgets (line+1, sizeof (line)-1, f) != NULL)
             {
-              p = strchr (line+1, '\n');
-              if (p != NULL) *p = 0;
-              p = strdup (line);
-              if (p == NULL)
-                goto out_of_memory;
-              RPUT (p+1);
+              char* token;
+              p = line+1;
+              // YD tokenize line, OOo uses \t to separate arguments
+              token = strtok( p, " \t\r\n");
+              while( token) {
+                char* p1 = strdup (token);
+                if (p1 == NULL)
+                  goto out_of_memory;
+                // YD strip begin/end whitespaces
+                while (isspace(p1[strlen(p1)-1]))
+                  p1[strlen(p1)-1] = 0;
+                while (isspace(*p1))
+                  p1++;
+                // YD strip begin&end quotes
+                if (*p1 == '\"' && p1[strlen(p1)-1] == '\"') {
+                  p1++;
+                  p1[strlen(p1)-1] = 0;
+                }
+                // YD don't add zero-len arguments!
+                if (strlen(p1)>0)
+                  RPUT (p1);
+                token = strtok( NULL, " \t\r\n");
+              }
             }
           if (ferror (f))
             {

#282 fixed Add DosDevIOCtl() to os2safe.h KO Myung-Hun
Description

Hi/2.

DosDevIOCtl() is not high-memory safe. So it should be added to os2safe.h

#296 wontfix Add SIGFPE handler to all threads dmik
Description

It is known that some OS/2 system DLLs and some third party DLLs unexpectedly reset the FPU control word to a value that causes FPU exceptions to be thrown by the CPU. This may happen to any application, no matter what compiler and runtime it uses. Even if the application doesn't load the "viral" DLL directly, it may be injected into the process by the system (i.e. via PM DLL hooks).

However, according to IEEE 754, the default action for FPU exceptions (e.g. divide by zero) in the compatible C runtime is to return a special value (e.g. Inf, infinity).

This often leads to a situation when the program does something like float f = 1.0 / .0; and expects to get an appropriate result (Inf in this case) but instead it gets a SIGFPE and unexpectedly terminates (crashes). There are dozens of user bug reports like that and they continue to come from time to time.

Some applications work around this issue by manually calling _control87() at appropriate times to restore the default IEEE FPU CW value that masks off all exceptions. However, this doesn't always work. First, there may be many places that can indirectly cause an exception and it's very hard to track them all to insert a _control87() call. Second, even if it's done, it's still theoretically possible that the viral DLL kicks in between. The only ultimate solution for the application is to install a system exception handler for each of its threads, intercept all FPU exceptions, reset the control word and retry.

In fact, virtually any application needs this fix, for any of its threads (including threads created by third party library functions). Doing this over and over in each application is a pain. Functionally this definitely belongs to the C runtime. Normal programs (including third party libraries) are expected to start new threads using beginthread(). And this is what most applications do.

So the FPU exception handler must be installed by LIBC both for main() and for all threads started with beginthread().

PS. GCC on Mac shows the correct behavior, no SIGFPE when I do things like float f = 1.0 / .0;. This is just to show that this is the expected behavior of the modern compiler.

1 2 3 4 5 6 7 8 9 10 11 12
Note: See TracQuery for help on using queries.