[retro-gtk] retro-core: Handle variables with just one value



commit 0d11c6d54f38c2247945fd30c0a813f6305f0315
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Mar 3 13:48:56 2020 +0500

    retro-core: Handle variables with just one value
    
    Don't assume the definition contains a | somewhere, it might not
    necessarily be true. If there's no |, assume everything after "; " is the
    default value.

 retro-runner/retro-core.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/retro-runner/retro-core.c b/retro-runner/retro-core.c
index 0470160..f9f2133 100644
--- a/retro-runner/retro-core.c
+++ b/retro-runner/retro-core.c
@@ -1019,6 +1019,9 @@ get_default_value (const gchar *description)
   values = description_separator + 2;
   value_separator = g_strstr_len (values, -1, "|");
 
+  if (!value_separator)
+    return g_strdup (values);
+
   return g_strndup (values, value_separator - values);
 }
 


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