219 |
{ |
{ |
220 |
pos[0] = '\0'; |
pos[0] = '\0'; |
221 |
pos++; |
pos++; |
222 |
|
|
223 |
|
/* remove spaces before '=' */ |
224 |
|
pos2 = pos - 2; |
225 |
|
while ((pos2 > line) && (pos2[0] == ' ')) |
226 |
|
{ |
227 |
|
pos2[0] = '\0'; |
228 |
|
pos2--; |
229 |
|
} |
230 |
|
|
231 |
|
/* skip spaces after '=' */ |
232 |
|
while (pos[0] && (pos[0] == ' ')) |
233 |
|
{ |
234 |
|
pos++; |
235 |
|
} |
236 |
|
|
237 |
|
/* remove CR/LF */ |
238 |
pos2 = strchr (pos, '\r'); |
pos2 = strchr (pos, '\r'); |
239 |
if (pos2 != NULL) |
if (pos2 != NULL) |
240 |
pos2[0] = '\0'; |
pos2[0] = '\0'; |
241 |
pos2 = strchr (pos, '\n'); |
pos2 = strchr (pos, '\n'); |
242 |
if (pos2 != NULL) |
if (pos2 != NULL) |
243 |
pos2[0] = '\0'; |
pos2[0] = '\0'; |
244 |
|
|
245 |
|
/* remove simple or double quotes |
246 |
|
and spaces at the end */ |
247 |
|
if (strlen(pos) > 1) |
248 |
|
{ |
249 |
|
pos2 = pos + strlen (pos) - 1; |
250 |
|
while ((pos2 > pos) && (pos2[0] == ' ')) |
251 |
|
{ |
252 |
|
pos2[0] = '\0'; |
253 |
|
pos2--; |
254 |
|
} |
255 |
|
pos2 = pos + strlen (pos) - 1; |
256 |
|
if (((pos[0] == '\'') && |
257 |
|
(pos2[0] == '\'')) || |
258 |
|
((pos[0] == '"') && |
259 |
|
(pos2[0] == '"'))) |
260 |
|
{ |
261 |
|
pos2[0] = '\0'; |
262 |
|
pos++; |
263 |
|
} |
264 |
|
} |
265 |
|
|
266 |
plugin_config_set_internal (ptr_line, pos); |
plugin_config_set_internal (ptr_line, pos); |
267 |
} |
} |
268 |
} |
} |
317 |
for (ptr_plugin_option = plugin_options; ptr_plugin_option; |
for (ptr_plugin_option = plugin_options; ptr_plugin_option; |
318 |
ptr_plugin_option = ptr_plugin_option->next_option) |
ptr_plugin_option = ptr_plugin_option->next_option) |
319 |
{ |
{ |
320 |
fprintf (file, "%s=%s\n", |
fprintf (file, "%s = \"%s\"\n", |
321 |
ptr_plugin_option->option_name, |
ptr_plugin_option->option_name, |
322 |
ptr_plugin_option->value); |
ptr_plugin_option->value); |
323 |
} |
} |