Fix workaround skipping leading 'x' for ModelNumStr

Yasuhiro MATSUMOTO <[email protected]> Thu, 27 Feb 2014 16:21:34 +0900
Newsgroups gmane.comp.ipod.gtkpod
Message-ID <CAJc+XFPwOiYaknDvnjAuf9+z-+gw2Rr9MPPXWgKTjRPqgW0X6g@mail.gmail.com>
--===============8972084321707934758==
Content-Type: multipart/alternative; boundary=001a11c027cccf9cce04f35e2b02

--001a11c027cccf9cce04f35e2b02
Content-Type: text/plain; charset=UTF-8

Hi.

Currently, some application (sorry i don't know) wrote SysInfo in below.
  /iPod_Control/Device/SysInfo
And it seems that gtkpod expect xY000 like string.
But some times this leading 'x' doesn't set. Maybe it depend on
libmodiledevice or another libraries?
Below is a patch for getting ModelNumStr old workaround.
Please check and include.

- Yasuhiro Matsumoto


diff --git a/src/itdb_device.c b/src/itdb_device.c
index 80995de..4f10675 100644
--- a/src/itdb_device.c
+++ b/src/itdb_device.c
@@ -2113,7 +2113,8 @@ get_ipod_info_from_model_number (const char
*model_number)
     g_return_val_if_fail (model_number != NULL, NULL);

     model_table = get_model_table ();
-    if(isalpha(model_number[0])) {
+    /* Fix workarounds skipping leading 'x' */
+    if(model_number[0] == 'x' && model_number[1] != '\0') {
  model_number++;
     }
     return g_hash_table_lookup (model_table->model_number_hash,
model_number);

--001a11c027cccf9cce04f35e2b02
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi.<br></div><div><br></div><div>Currently, some appl=
ication (sorry i don&#39;t know) wrote SysInfo in below.</div><div>=C2=A0 /=
iPod_Control/Device/SysInfo</div><div>And it seems that gtkpod expect xY000=
 like string.</div>
<div>But some times this leading &#39;x&#39; doesn&#39;t set. Maybe it depe=
nd on libmodiledevice or another libraries?</div><div>Below is a patch for =
getting ModelNumStr old workaround.</div><div>Please check and include.</di=
v>
<div><br></div><div>- Yasuhiro Matsumoto</div><div><br></div><div><br></div=
><div>diff --git a/src/itdb_device.c b/src/itdb_device.c</div><div>index 80=
995de..4f10675 100644</div><div>--- a/src/itdb_device.c</div><div>+++ b/src=
/itdb_device.c</div>
<div>@@ -2113,7 +2113,8 @@ get_ipod_info_from_model_number (const char *mod=
el_number)</div><div>=C2=A0 =C2=A0 =C2=A0g_return_val_if_fail (model_number=
 !=3D NULL, NULL);</div><div>=C2=A0</div><div>=C2=A0 =C2=A0 =C2=A0model_tab=
le =3D get_model_table ();</div><div>
- =C2=A0 =C2=A0if(isalpha(model_number[0])) {</div><div>+ =C2=A0 =C2=A0/* F=
ix workarounds skipping leading &#39;x&#39; */</div><div>+ =C2=A0 =C2=A0if(=
model_number[0] =3D=3D &#39;x&#39; &amp;&amp; model_number[1] !=3D &#39;\0&=
#39;) {</div><div>=C2=A0<span class=3D"" style=3D"white-space:pre">	</span>=
model_number++;</div>
<div>=C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =C2=A0 =C2=A0return g_hash_tabl=
e_lookup (model_table-&gt;model_number_hash, model_number);</div><div><br><=
/div>
</div>

--001a11c027cccf9cce04f35e2b02--


--===============8972084321707934758==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
--===============8972084321707934758==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Gtkpod-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-devel

--===============8972084321707934758==--