[gnome-games] playstation: Move the header to uppercase before checking it



commit 52750334cb7b87025bfc1a7afcce75b1ce8df7ad
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Aug 31 08:43:13 2016 +0200

    playstation: Move the header to uppercase before checking it
    
    This allows IDs in lowercase to be detected and hence more games to be
    detected.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770626

 plugins/playstation/src/playstation-header.vala |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/plugins/playstation/src/playstation-header.vala b/plugins/playstation/src/playstation-header.vala
index e2d3edf..8790230 100644
--- a/plugins/playstation/src/playstation-header.vala
+++ b/plugins/playstation/src/playstation-header.vala
@@ -16,6 +16,7 @@ private class Games.PlayStationHeader : Object {
        };
        private const string BOOT_MAGIC_VALUE = "BOOT";
 
+       // The ID prefixes must always be in uppercase.
        private const string[] IDS = { "SLUS", "SCUS", "SLES", "SCES", "SLPS", "SLPM", "SCPS" };
        private const size_t DISC_ID_SIZE = 10;
 
@@ -86,6 +87,7 @@ private class Games.PlayStationHeader : Object {
 
                var stream = new StringInputStream (file);
                var header = stream.read_string (offset);
+               header = header.up ();
 
                foreach (var id in IDS) {
                        if (!(id in header))


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