Ticket #8338: 0001-Fix-input_server-tablet-add-on-name-generation.-Mult.patch

File 0001-Fix-input_server-tablet-add-on-name-generation.-Mult.patch, 1.1 KB (added by X512, 10 years ago)

patch

  • src/add-ons/input_server/devices/tablet/TabletInputDevice.cpp

    From 0b735247920497c104900c03c1ba320b7f845c11 Mon Sep 17 00:00:00 2001
    From: X512 <danger_mail@list.ru>
    Date: Tue, 4 Nov 2014 08:20:32 +0000
    Subject: [PATCH] Fix input_server tablet add-on name generation. Multiple
     tablet device support are working now.
    
    ---
     src/add-ons/input_server/devices/tablet/TabletInputDevice.cpp | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/src/add-ons/input_server/devices/tablet/TabletInputDevice.cpp b/src/add-ons/input_server/devices/tablet/TabletInputDevice.cpp
    index 283231a..763e44b 100644
    a b TabletDevice::_BuildShortName() const  
    250250    BString name;
    251251
    252252    int32 slash = string.FindLast("/");
    253     string.CopyInto(name, slash + 1, string.Length() - slash);
     253
     254    int32 indexPos = slash + 1;
     255    while (string[indexPos] != 0 && !(string[indexPos] >= '0' && string[indexPos] <= '9')) ++indexPos;
     256    string.CopyInto(name, indexPos, string.Length() - indexPos);
    254257    int32 index = atoi(name.String()) + 1;
    255258
    256259    int32 previousSlash = string.FindLast("/", slash);