From: Daniele F. <df...@gm...> - 2014-02-27 11:47:04
|
2014-02-27 8:21 GMT+01:00 Yasuhiro MATSUMOTO: > 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') { why are you testing model_number[1]? the original code didn't test it if you want the leading 'x' if present I would remove the comment and just do that: - if(isalpha(model_number[0])) { + if (model_number[0] == 'x') { for consistency, it's better to add a space between "if" and the opening parens (there are only 2 lines in this file where "if" isn't followed by a space and 76 where it is followed by a space) -- Daniele Forsi |