gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r10381: Fix some typos in parseAttri


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10381: Fix some typos in parseAttribute: unescape, not escape attributes;
Date: Wed, 03 Dec 2008 16:25:56 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10381
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2008-12-03 16:25:56 +0100
message:
  Fix some typos in parseAttribute: unescape, not escape attributes;
  and '\\' is the escape character for quotes, not '\''.
  
  Clean up some older code.
modified:
  libcore/asobj/XML_as.cpp
=== modified file 'libcore/asobj/XML_as.cpp'
--- a/libcore/asobj/XML_as.cpp  2008-11-24 16:07:05 +0000
+++ b/libcore/asobj/XML_as.cpp  2008-12-03 15:25:56 +0000
@@ -250,7 +250,7 @@
     do {
         ++end;
         end = std::find(end, xml.end(), *it);
-    } while (end != xml.end() && *(end - 1) == '\'');
+    } while (end != xml.end() && *(end - 1) == '\\');
 
     if (end == xml.end()) {
         _status = XML_UNTERMINATED_ATTRIBUTE;
@@ -259,6 +259,10 @@
     ++it;
 
     std::string value(it, end);
+
+    // Replace entities in the value.
+    unescape(value);
+
     //log_debug("adding attribute to node %s: %s, %s", node->nodeName(),
     //        name, value);
 
@@ -268,9 +272,6 @@
     // Advance past the last attribute character
     ++it;
 
-    // Replace entities in the value.
-    escape(value);
-
     // Handle namespace. This is set once only for each node, and is also
     // pushed to the attributes list once.
     StringNoCaseEqual noCaseCompare;
@@ -527,7 +528,6 @@
     // Clear current data
     clear(); 
     _status = XML_OK;
-    
 
     std::string::const_iterator it = xml.begin();
     XMLNode_as* node = this;
@@ -579,7 +579,6 @@
 {
     // TODO: should set childs's parent to NULL ?
     _children.clear();
-    //_attributes.clear();
     _docTypeDecl.clear();
     _xmlDecl.clear();
 }
@@ -590,7 +589,9 @@
 
     string_table::key propnamekey = _vm.getStringTable().find("ignoreWhite");
     as_value val;
-    if (!const_cast<XML_as*>(this)->get_member(propnamekey, &val)) return 
false;
+    if (!const_cast<XML_as*>(this)->get_member(propnamekey, &val)) {
+        return false;
+    }
     return val.to_bool();
 }
 
@@ -617,7 +618,6 @@
 
 namespace {
 
-
 void
 attachXMLProperties(as_object& /*o*/)
 {
@@ -670,7 +670,6 @@
 as_value
 xml_new(const fn_call& fn)
 {
-    as_value inum;
     boost::intrusive_ptr<XML_as> xml_obj;
   
     if ( fn.nargs > 0 )
@@ -874,7 +873,7 @@
     return as_value();
 }
 
-/// Case insenstive match of a string, returning false if there too few
+/// Case insensitive match of a string, returning false if there too few
 /// characters left or if there is no match. If there is a match, and advance
 /// is not false, the iterator points to the character after the match.
 bool
@@ -917,8 +916,9 @@
 ///                 the tag.
 /// @param xml      The complete XML string.
 bool
-parseNodeWithTerminator(const std::string& xml, std::string::const_iterator& 
it,
-        const std::string& terminator, std::string& content)
+parseNodeWithTerminator(const std::string& xml,
+        std::string::const_iterator& it, const std::string& terminator,
+        std::string& content)
 {
     std::string::const_iterator end = std::search(it, xml.end(),
             terminator.begin(), terminator.end());


reply via email to

[Prev in Thread] Current Thread [Next in Thread]