aboutsummaryrefslogtreecommitdiff
path: root/src/arm/do_start_process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm/do_start_process.c')
-rw-r--r--src/arm/do_start_process.c79
1 files changed, 39 insertions, 40 deletions
diff --git a/src/arm/do_start_process.c b/src/arm/do_start_process.c
index a2aca9dea..19b3bc224 100644
--- a/src/arm/do_start_process.c
+++ b/src/arm/do_start_process.c
@@ -13,8 +13,7 @@
13 * @return PID of the started process, -1 on error 13 * @return PID of the started process, -1 on error
14 */ 14 */
15static struct GNUNET_OS_Process * 15static struct GNUNET_OS_Process *
16do_start_process (const int *lsocks, 16do_start_process (const int *lsocks, const char *first_arg, ...)
17 const char *first_arg, ...)
18{ 17{
19 va_list ap; 18 va_list ap;
20 char **argv; 19 char **argv;
@@ -34,24 +33,24 @@ do_start_process (const int *lsocks,
34 do 33 do
35 { 34 {
36/* *INDENT-ON* */ 35/* *INDENT-ON* */
37 rpos = arg; 36 rpos = arg;
38 while ('\0' != *rpos) 37 while ('\0' != *rpos)
39 { 38 {
40 if (' ' == *rpos) 39 if (' ' == *rpos)
41 { 40 {
42 if (last != NULL)
43 argv_size++;
44 last = NULL;
45 while (' ' == *rpos)
46 rpos++;
47 }
48 if ( (last == NULL) && (*rpos != '\0') )
49 last = rpos;
50 if (*rpos != '\0')
51 rpos++;
52 }
53 if (last != NULL) 41 if (last != NULL)
54 argv_size++; 42 argv_size++;
43 last = NULL;
44 while (' ' == *rpos)
45 rpos++;
46 }
47 if ((last == NULL) && (*rpos != '\0'))
48 last = rpos;
49 if (*rpos != '\0')
50 rpos++;
51 }
52 if (last != NULL)
53 argv_size++;
55/* *INDENT-OFF* */ 54/* *INDENT-OFF* */
56 } 55 }
57 while (NULL != (arg = (va_arg (ap, const char*)))); 56 while (NULL != (arg = (va_arg (ap, const char*))));
@@ -67,29 +66,29 @@ do_start_process (const int *lsocks,
67 do 66 do
68 { 67 {
69/* *INDENT-ON* */ 68/* *INDENT-ON* */
70 cp = GNUNET_strdup (arg); 69 cp = GNUNET_strdup (arg);
71 pos = cp; 70 pos = cp;
72 while ('\0' != *pos) 71 while ('\0' != *pos)
73 { 72 {
74 if (' ' == *pos) 73 if (' ' == *pos)
75 { 74 {
76 *pos = '\0'; 75 *pos = '\0';
77 if (last != NULL)
78 argv[argv_size++] = GNUNET_strdup (last);
79 last = NULL;
80 pos++;
81 while (' ' == *pos)
82 pos++;
83 }
84 if ( (last == NULL) && (*pos != '\0') )
85 last = pos;
86 if (*pos != '\0')
87 pos++;
88 }
89 if (last != NULL) 76 if (last != NULL)
90 argv[argv_size++] = GNUNET_strdup (last); 77 argv[argv_size++] = GNUNET_strdup (last);
91 last = NULL; 78 last = NULL;
92 GNUNET_free (cp); 79 pos++;
80 while (' ' == *pos)
81 pos++;
82 }
83 if ((last == NULL) && (*pos != '\0'))
84 last = pos;
85 if (*pos != '\0')
86 pos++;
87 }
88 if (last != NULL)
89 argv[argv_size++] = GNUNET_strdup (last);
90 last = NULL;
91 GNUNET_free (cp);
93/* *INDENT-OFF* */ 92/* *INDENT-OFF* */
94 } 93 }
95 while (NULL != (arg = (va_arg (ap, const char*)))); 94 while (NULL != (arg = (va_arg (ap, const char*))));