summaryrefslogtreecommitdiff
path: root/udev_config.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-12-20 07:38:33 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:19:09 -0700
commit9f8dfa19cfd2b502bf794f39a421cbb7c4cc0404 (patch)
treeb91b9ebebd7a08a722d60495af2a2b594dd50d0e /udev_config.c
parenta07dc29e602440541ce531e03737bc1f926a0ef3 (diff)
[PATCH] allow multiline rules by backslash at the end of the line
On Sun, 2004-12-19 at 18:31 +0100, Marco d'Itri wrote: > > On Dec 19, Kay Sievers <kay.sievers@vrfy.org> wrote: > > > (Feature request: would it be possible to extend the rules files parser > > to support continuation lines? I'd like it to consider lines starting > > with white space as part of the previous line.) > > How about the usual backslash at the end of the line. Here is a simple > patch.
Diffstat (limited to 'udev_config.c')
-rw-r--r--udev_config.c54
1 files changed, 6 insertions, 48 deletions
diff --git a/udev_config.c b/udev_config.c
index 31c2a86ed1..da8c676d04 100644
--- a/udev_config.c
+++ b/udev_config.c
@@ -91,41 +91,6 @@ static void init_variables(void)
udev_hotplug_d = 0;
}
-int parse_get_pair(char **orig_string, char **left, char **right)
-{
- char *temp;
- char *string = *orig_string;
-
- if (!string)
- return -ENODEV;
-
- /* eat any whitespace */
- while (isspace(*string) || *string == ',')
- ++string;
-
- /* split based on '=' */
- temp = strsep(&string, "=");
- *left = temp;
- if (!string)
- return -ENODEV;
-
- /* take the right side and strip off the '"' */
- while (isspace(*string))
- ++string;
- if (*string == '"')
- ++string;
- else
- return -ENODEV;
-
- temp = strsep(&string, "\"");
- if (!string || *temp == '\0')
- return -ENODEV;
- *right = temp;
- *orig_string = string;
-
- return 0;
-}
-
static int parse_config_file(void)
{
char line[LINE_SIZE];
@@ -254,20 +219,13 @@ static void get_dirs(void)
strfieldcpy(udev_config_filename, temp);
}
- dbg("sysfs_path='%s'", sysfs_path);
- dbg_parse("udev_root = %s", udev_root);
- dbg_parse("udev_config_filename = %s", udev_config_filename);
- dbg_parse("udev_db_path = %s", udev_db_path);
- dbg_parse("udev_rules_filename = %s", udev_rules_filename);
- dbg_parse("udev_log = %d", udev_log);
-
parse_config_file();
-
- dbg("udev_root = %s", udev_root);
- dbg("udev_config_filename = %s", udev_config_filename);
- dbg("udev_db_path = %s", udev_db_path);
- dbg("udev_rules_filename = %s", udev_rules_filename);
- dbg("udev_log = %d", udev_log);
+ dbg("sysfs_path='%s'", sysfs_path);
+ dbg("udev_root='%s'", udev_root);
+ dbg("udev_config_filename='%s'", udev_config_filename);
+ dbg("udev_db_path='%s'", udev_db_path);
+ dbg("udev_rules_filename='%s'", udev_rules_filename);
+ dbg("udev_log=%d", udev_log);
}
void udev_init_config(void)