dbus/bus desktop-file.c,1.15,1.16
Ralf Habacker
rhabacker at kemper.freedesktop.org
Tue Dec 12 15:58:34 PST 2006
Update of /cvs/dbus/dbus/bus
In directory kemper:/tmp/cvs-serv12640/bus
Modified Files:
desktop-file.c
Log Message:
* dbus/dbus-string.c (_dbus_string_pop_line),
bus/desktop-file.c (parse_section_start,
parse_comment_or_blank,parse_key_value,): uses
_dbus_string_find_eol() to support platform independent eol style.
Index: desktop-file.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/desktop-file.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- desktop-file.c 23 Oct 2006 17:25:52 -0000 1.15
+++ desktop-file.c 12 Dec 2006 23:58:32 -0000 1.16
@@ -360,15 +360,15 @@
static void
parse_comment_or_blank (BusDesktopFileParser *parser)
{
- int line_end;
+ int line_end, eol_len;
- if (!_dbus_string_find (&parser->data, parser->pos, "\n", &line_end))
+ if (!_dbus_string_find_eol (&parser->data, parser->pos, &line_end, &eol_len))
line_end = parser->len;
if (line_end == parser->len)
parser->pos = parser->len;
else
- parser->pos = line_end + 1;
+ parser->pos = line_end + eol_len;
parser->line_num += 1;
}
@@ -393,12 +393,12 @@
static dbus_bool_t
parse_section_start (BusDesktopFileParser *parser, DBusError *error)
{
- int line_end;
+ int line_end, eol_len;
char *section_name;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!_dbus_string_find (&parser->data, parser->pos, "\n", &line_end))
+
+ if (!_dbus_string_find_eol (&parser->data, parser->pos, &line_end, &eol_len))
line_end = parser->len;
if (line_end - parser->pos <= 2 ||
@@ -438,7 +438,7 @@
if (line_end == parser->len)
parser->pos = parser->len;
else
- parser->pos = line_end + 1;
+ parser->pos = line_end + eol_len;
parser->line_num += 1;
@@ -450,7 +450,7 @@
static dbus_bool_t
parse_key_value (BusDesktopFileParser *parser, DBusError *error)
{
- int line_end;
+ int line_end, eol_len;
int key_start, key_end;
int value_start;
int p;
@@ -460,7 +460,7 @@
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- if (!_dbus_string_find (&parser->data, parser->pos, "\n", &line_end))
+ if (!_dbus_string_find_eol (&parser->data, parser->pos, &line_end, &eol_len))
line_end = parser->len;
p = parser->pos;
@@ -483,7 +483,7 @@
if (line_end == parser->len)
parser->pos = parser->len;
else
- parser->pos = line_end + 1;
+ parser->pos = line_end + eol_len;
parser->line_num += 1;
@@ -568,7 +568,7 @@
if (line_end == parser->len)
parser->pos = parser->len;
else
- parser->pos = line_end + 1;
+ parser->pos = line_end + eol_len;
parser->line_num += 1;
More information about the dbus-commit
mailing list