| OLD | NEW |
| 1 /* Utilities to execute a program in a subprocess (possibly linked by pipes | 1 /* Utilities to execute a program in a subprocess (possibly linked by pipes |
| 2 with other subprocesses), and wait for it. Generic Unix version | 2 with other subprocesses), and wait for it. Generic Unix version |
| 3 (also used for UWIN and VMS). | 3 (also used for UWIN and VMS). |
| 4 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2009, | 4 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2009, |
| 5 2010 Free Software Foundation, Inc. | 5 2010 Free Software Foundation, Inc. |
| 6 | 6 |
| 7 This file is part of the libiberty library. | 7 This file is part of the libiberty library. |
| 8 Libiberty is free software; you can redistribute it and/or | 8 Libiberty is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 /* Return a 32 bit pointer to an array of 32 bit pointers | 79 /* Return a 32 bit pointer to an array of 32 bit pointers |
| 80 given a 64 bit pointer to an array of 64 bit pointers. */ | 80 given a 64 bit pointer to an array of 64 bit pointers. */ |
| 81 | 81 |
| 82 static __char_ptr_char_ptr32 | 82 static __char_ptr_char_ptr32 |
| 83 to_ptr32 (char **ptr64) | 83 to_ptr32 (char **ptr64) |
| 84 { | 84 { |
| 85 int argc; | 85 int argc; |
| 86 __char_ptr_char_ptr32 short_argv; | 86 __char_ptr_char_ptr32 short_argv; |
| 87 | 87 |
| 88 for (argc=0; ptr64[argc]; argc++); | 88 /* Count number of arguments. */ |
| 89 for (argc = 0; ptr64[argc] != NULL; argc++) |
| 90 ; |
| 89 | 91 |
| 90 /* Reallocate argv with 32 bit pointers. */ | 92 /* Reallocate argv with 32 bit pointers. */ |
| 91 short_argv = (__char_ptr_char_ptr32) decc$malloc | 93 short_argv = (__char_ptr_char_ptr32) decc$malloc |
| 92 (sizeof (__char_ptr32) * (argc + 1)); | 94 (sizeof (__char_ptr32) * (argc + 1)); |
| 93 | 95 |
| 94 for (argc=0; ptr64[argc]; argc++) | 96 for (argc = 0; ptr64[argc] != NULL; argc++) |
| 95 short_argv[argc] = (__char_ptr32) decc$strdup (ptr64[argc]); | 97 short_argv[argc] = (__char_ptr32) decc$strdup (ptr64[argc]); |
| 96 | 98 |
| 97 short_argv[argc] = (__char_ptr32) 0; | 99 short_argv[argc] = (__char_ptr32) 0; |
| 98 return short_argv; | 100 return short_argv; |
| 99 | 101 |
| 100 } | 102 } |
| 101 #else | 103 #else |
| 102 #define to_ptr32(argv) argv | 104 #define to_ptr32(argv) argv |
| 103 #endif | 105 #endif |
| 104 | 106 |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 struct status_list *this; | 781 struct status_list *this; |
| 780 struct status_list *next; | 782 struct status_list *next; |
| 781 | 783 |
| 782 this = (struct status_list *) obj->sysdep; | 784 this = (struct status_list *) obj->sysdep; |
| 783 next = this->next; | 785 next = this->next; |
| 784 free (this); | 786 free (this); |
| 785 obj->sysdep = (void *) next; | 787 obj->sysdep = (void *) next; |
| 786 } | 788 } |
| 787 #endif | 789 #endif |
| 788 } | 790 } |
| OLD | NEW |