summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-marshal-validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-marshal-validate.c')
-rw-r--r--dbus/dbus-marshal-validate.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c
index 285f1efb..ced5e1ea 100644
--- a/dbus/dbus-marshal-validate.c
+++ b/dbus/dbus-marshal-validate.c
@@ -482,6 +482,25 @@ _dbus_validate_body_with_reason (const DBusString *expected_signature,
}
/**
+ * Determine wether the given charater is valid as the first charater
+ * in a name.
+ */
+#define VALID_INITIAL_NAME_CHARACTER(c) \
+ ( ((c) >= 'A' && (c) <= 'Z') || \
+ ((c) >= 'a' && (c) <= 'z') || \
+ ((c) == '_') )
+
+/**
+ * Determine wether the given charater is valid as a second or later
+ * character in a name
+ */
+#define VALID_NAME_CHARACTER(c) \
+ ( ((c) >= '0' && (c) <= '9') || \
+ ((c) >= 'A' && (c) <= 'Z') || \
+ ((c) >= 'a' && (c) <= 'z') || \
+ ((c) == '_') )
+
+/**
* Checks that the given range of the string is a valid object path
* name in the D-BUS protocol. Part of the validation ensures that
* the object path contains only ASCII.
@@ -535,7 +554,7 @@ _dbus_validate_path (const DBusString *str,
}
else
{
- if (_DBUS_UNLIKELY (!_DBUS_ISASCII (*s)))
+ if (_DBUS_UNLIKELY (!VALID_NAME_CHARACTER (*s)))
return FALSE;
}
@@ -550,25 +569,6 @@ _dbus_validate_path (const DBusString *str,
}
/**
- * Determine wether the given charater is valid as the first charater
- * in a name.
- */
-#define VALID_INITIAL_NAME_CHARACTER(c) \
- ( ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') )
-
-/**
- * Determine wether the given charater is valid as a second or later
- * character in a name
- */
-#define VALID_NAME_CHARACTER(c) \
- ( ((c) >= '0' && (c) <= '9') || \
- ((c) >= 'A' && (c) <= 'Z') || \
- ((c) >= 'a' && (c) <= 'z') || \
- ((c) == '_') )
-
-/**
* Checks that the given range of the string is a valid interface name
* in the D-BUS protocol. This includes a length restriction and an
* ASCII subset, see the specification.