Displaying 12 results from an estimated 12 matches for "parse_string_list".
2009 Sep 11
1
[PATCH] guestfish: Enable grouping in string lists
...any amount of
whitespace rather than a single whitespace character. I.e.:
"a b"
resolves to:
'a' 'b'
rather than:
'a' '' 'b'
That last syntax can be used if an empty argument is still desired. Whitespace
is now also defined to include tabs.
parse_string_list can also now fail if it contains an unmatched open quote.
---
fish/fish.c | 131 +++++++++++++++++++++++++++++++++++++++++++++--------
guestfish.pod | 6 ++-
src/generator.ml | 3 +-
3 files changed, 118 insertions(+), 22 deletions(-)
diff --git a/fish/fish.c b/fish/fish.c
index a4...
2009 Sep 11
1
[FOR REVIEW ONLY] guestfish: Enable grouping in string lists
...iour
of the previous implementation, in that tokens are separated by any amount of
whitespace rather than a single whitespace character. I.e.:
"a b"
resolves to:
'a' 'b'
rather than:
'a' '' 'b'
Whitespace is now also defined to include tabs.
parse_string_list can also now fail if it contains an unmatched open quote.
---
fish/fish.c | 129 +++++++++++++++++++++++++++++++++++++++++++++--------
src/generator.ml | 3 +-
2 files changed, 111 insertions(+), 21 deletions(-)
diff --git a/fish/fish.c b/fish/fish.c
index a4069d6..62ec3a3 100644
--- a/f...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...(issue_command (cmd, params, NULL) == -1) exit (EXIT_FAILURE);
} else {
argv[optind] = NULL;
- if (issue_command (cmd, params, NULL) == -1) exit (1);
+ if (issue_command (cmd, params, NULL) == -1) exit (EXIT_FAILURE);
cmdline (argv, optind+1, argc);
}
}
@@ -1191,7 +1191,7 @@ parse_string_list (const char *str)
perror ("realloc");
free_n_strings (argv, argv_len);
free (tok);
- exit (1);
+ exit (EXIT_FAILURE);
}
tok = tok_new;
@@ -1237,7 +1237,7 @@ parse_string_list (const char *str)
perror ("realloc");...
2009 Sep 24
1
enabling more syntax-checks
...t;
#include "progname.h"
@@ -579,7 +579,7 @@ script (int prompt)
/* Skip any initial whitespace before the command. */
again:
- while (*buf && isspace (*buf))
+ while (*buf && c_isspace (*buf))
buf++;
if (!*buf) continue;
@@ -1127,7 +1127,7 @@ parse_string_list (const char *str)
* as separate fragments because we can't just copy it: we have to remove
* the \.
*/
- while (*p && (!isblank (*p) || in_quote)) {
+ while (*p && (!c_isblank (*p) || in_quote)) {
const char *end = p;
/* Check if the fragme...
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky
for development (too easy to miss new ones) so I spent some
time last week and today working on removing them.
The first patch gets us down to almost no warnings with
the original -Wall setting. That was by far the hardest part.
Once I'd done that, I enabled nearly all of gcc's warnings via
gnulib's warnings and manywarnings modules
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
...>
pr " %s = file_out (argv[i++]);\n" name;
pr " if (%s == NULL) goto out_%s;\n" name name
- | StringList name | DeviceList name ->
+ | StringList name | DeviceList name | RelativePathnameList name ->
pr " %s = parse_string_list (argv[i++]);\n" name;
pr " if (%s == NULL) goto out_%s;\n" name name
| Key name ->
@@ -678,7 +679,7 @@ Guestfish will prompt for these separately."
| FileIn name ->
pr " free_file_in (%s);\n" name;
pr &qu...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
...t name ->
pr " %s = file_out (argv[i++]);\n" name;
pr " if (%s == NULL) goto out_%s;\n" name name
- | StringList name | DeviceList name ->
+ | StringList name | DeviceList name | FilenameList name ->
pr " %s = parse_string_list (argv[i++]);\n" name;
pr " if (%s == NULL) goto out_%s;\n" name name
| Key name ->
@@ -678,7 +679,7 @@ Guestfish will prompt for these separately."
| FileIn name ->
pr " free_file_in (%s);\n" name;
pr &qu...
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...[%d], \"-\") != 0 ? argv[%d] : \"/dev/stdout\";\n"
+ pr " %s = STRNEQ (argv[%d], \"-\") ? argv[%d] : \"/dev/stdout\";\n"
name i i
| StringList name | DeviceList name ->
pr " %s = parse_string_list (argv[%d]);\n" name i;
--
1.6.5.2.351.g0943
>From 0c20bd8ea7092b93074ff08cae70e4cf6a06e7c5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Mon, 9 Nov 2009 22:33:36 +0100
Subject: [PATCH libguestfs 08/10] change strncasecmp() == 0 to STRCASENEQLEN()
git gr...
2012 Aug 14
7
[PATCH 0/7] Add tar compress, numericowner, excludes flags.
https://bugzilla.redhat.com/show_bug.cgi?id=847880
https://bugzilla.redhat.com/show_bug.cgi?id=847881
This patch series adds various optional arguments to the tar-in and
tar-out commands.
Firstly (1/7) an optional "compress" flag is added to select
compression. This makes the calls tgz-in/tgz-out/txz-in/txz-out
deprecated, and expands the range of compression types available.
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...strcmp (argv[%d], \"-\") != 0 ? argv[%d] : \"/dev/stdin\";\n"
- name i i
- | FileOut name ->
- pr " %s = strcmp (argv[%d], \"-\") != 0 ? argv[%d] : \"/dev/stdout\";\n"
- name i i
- | StringList name ->
- pr " %s = parse_string_list (argv[%d]);\n" name i
- | Bool name ->
- pr " %s = is_true (argv[%d]) ? 1 : 0;\n" name i
- | Int name ->
- pr " %s = atoi (argv[%d]);\n" name i
+ fun i ->
+ function
+ | String name -> pr " %s = argv[%d];\n"...
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...ing (FileOut, name) ->
pr " %s = file_out (argv[i++]);\n" name;
pr " if (%s == NULL) goto out_%s;\n" name name
- | StringList name | DeviceList name | FilenameList name ->
+ | StringList (_, name) ->
pr " %s = parse_string_list (argv[i++]);\n" name;
pr " if (%s == NULL) goto out_%s;\n" name name
- | Key name ->
+ | String (Key, name) ->
pr " %s = read_key (\"%s\");\n" name name;
pr " if (keys_from_stdin)\n";...
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator.
Rich.