summaryrefslogtreecommitdiffstats
path: root/src/xml/repr-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/repr-util.cpp')
-rw-r--r--src/xml/repr-util.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp
index 6899e77ee..5b8ab12ae 100644
--- a/src/xml/repr-util.cpp
+++ b/src/xml/repr-util.cpp
@@ -261,8 +261,13 @@ gchar const *sp_xml_ns_uri_prefix(gchar const *uri, gchar const *suggested)
GQuark const prefix_key=g_quark_from_string(suggested);
SPXMLNs *found=namespaces;
- while ( found && found->prefix != prefix_key ) {
- found = found->next;
+ while (found) {
+ if (found->prefix != prefix_key) {
+ found = found->next;
+ }
+ else {
+ break;
+ }
}
if (found) { // prefix already used?