gnome-mud r795 - in trunk: . src



Author: lharris
Date: Sun Mar 15 01:35:15 2009
New Revision: 795
URL: http://svn.gnome.org/viewvc/gnome-mud?rev=795&view=rev

Log:
Don't include TEL_SE in parsing key/value pairs.


Modified:
   trunk/ChangeLog
   trunk/src/mud-telnet-mssp.c
   trunk/src/mud-telnet-new-environ.c

Modified: trunk/src/mud-telnet-mssp.c
==============================================================================
--- trunk/src/mud-telnet-mssp.c	(original)
+++ trunk/src/mud-telnet-mssp.c	Sun Mar 15 01:35:15 2009
@@ -299,7 +299,7 @@
 
     state = PARSE_STATE_VAR;
 
-    for(i = 0; i < len; ++i)
+    for(i = 0; i < len - 1; ++i)
     {
         switch(state)
         {
@@ -353,7 +353,7 @@
                     }
                 }
 
-                if( i + 1 == len) // Last value in subnegotiation.
+                if( i + 1 == len - 1) // Last value in subnegotiation.
                     g_hash_table_replace(self->priv->mssp_data,
                                          g_string_free(key, FALSE),
                                          g_string_free(value, FALSE));

Modified: trunk/src/mud-telnet-new-environ.c
==============================================================================
--- trunk/src/mud-telnet-new-environ.c	(original)
+++ trunk/src/mud-telnet-new-environ.c	Sun Mar 15 01:35:15 2009
@@ -315,7 +315,7 @@
     /* The first byte will be either IS or INFO. Since INFO
      * simply updates variables we do not need to make a
      * distinction between the two in our case.*/
-    for(i = 1; i < len; ++i)
+    for(i = 1; i < len - 1; ++i)
     {
         switch(state)
         {
@@ -334,6 +334,7 @@
                     {
                         if( buf[ i + 1] != TEL_NEWENVIRON_VALUE )
                         {
+                            g_printf("VALUE undefined.\n");
                             /* No VALUE follows USERVAR/VAR. So it
                              * is undefined. */
                             g_string_free(key, TRUE);
@@ -378,7 +379,7 @@
                     }
                 }
 
-                if( i + 1 == len) // Last value in subnegotiation.
+                if( i + 1 == len - 1) // Last value in subnegotiation.
                     g_hash_table_replace(self->priv->new_environ_data,
                                          g_string_free(key, FALSE),
                                          g_string_free(value, FALSE));



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