/[gnokii]/gnokii/gnokii/gnokii.c
ViewVC logotype

Diff of /gnokii/gnokii/gnokii.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.422 by pkot, Sun Jul 17 11:33:44 2005 UTC revision 1.423 by bozo, Mon Jul 18 22:05:11 2005 UTC
# Line 1296  static int getsms(int argc, char *argv[] Line 1296  static int getsms(int argc, char *argv[]
1296    
1297                  /* [end] can be only argv[4] */                  /* [end] can be only argv[4] */
1298                  if (argv[4][0] != '-') {                  if (argv[4][0] != '-') {
1299                          end_message = atoi(argv[4]);                          if (!strcmp(argv[4], "end" ))
1300                                    end_message = INT_MAX;
1301                            else
1302                                    end_message = atoi(argv[4]);
1303                  }                  }
1304    
1305                  /* parse all options (beginning with '-' */                  /* parse all options (beginning with '-' */
# Line 1509  static int getsms(int argc, char *argv[] Line 1512  static int getsms(int argc, char *argv[]
1512                          }                          }
1513                          break;                          break;
1514                  default:                  default:
1515                            if ((error == GN_ERR_INVALIDLOCATION) && (end_message == INT_MAX) && (count > start_message))
1516                                    return GN_ERR_NONE;
1517                          fprintf(stderr, _("GetSMS %s %d failed! (%s)\n"), memory_type_string, count, gn_error_print(error));                          fprintf(stderr, _("GetSMS %s %d failed! (%s)\n"), memory_type_string, count, gn_error_print(error));
1518                          if (error == GN_ERR_INVALIDMEMORYTYPE)                          if (error == GN_ERR_INVALIDMEMORYTYPE)
1519                                  fprintf(stderr, _("See the gnokii manual page for the supported memory types with the phone\nyou use.\n"));                                  fprintf(stderr, _("See the gnokii manual page for the supported memory types with the phone\nyou use.\n"));
# Line 1541  static int deletesms(int argc, char *arg Line 1546  static int deletesms(int argc, char *arg
1546          }          }
1547    
1548          start_message = end_message = atoi(argv[1]);          start_message = end_message = atoi(argv[1]);
1549          if (argc > 2) end_message = atoi(argv[2]);          if (argc > 2) {
1550                    if (!strcmp(argv[2], "end"))
1551                            end_message = INT_MAX;
1552                    else
1553                            end_message = atoi(argv[2]);
1554            }
1555    
1556          /* Now delete the requested entries. */          /* Now delete the requested entries. */
1557          for (count = start_message; count <= end_message; count++) {          for (count = start_message; count <= end_message; count++) {
# Line 1553  static int deletesms(int argc, char *arg Line 1563  static int deletesms(int argc, char *arg
1563    
1564                  if (error == GN_ERR_NONE)                  if (error == GN_ERR_NONE)
1565                          fprintf(stderr, _("Deleted SMS %s %d\n"), memory_type_string, count);                          fprintf(stderr, _("Deleted SMS %s %d\n"), memory_type_string, count);
1566                  else                  else {
1567                            if ((error == GN_ERR_INVALIDLOCATION) && (end_message == INT_MAX) && (count > start_message))
1568                                    return GN_ERR_NONE;
1569                          fprintf(stderr, _("DeleteSMS %s %d failed!(%s)\n\n"), memory_type_string, count, gn_error_print(error));                          fprintf(stderr, _("DeleteSMS %s %d failed!(%s)\n\n"), memory_type_string, count, gn_error_print(error));
1570                    }
1571          }          }
1572    
1573          /* FIXME: We return the value of the last read.          /* FIXME: We return the value of the last read.

Legend:
Removed from v.1.422  
changed lines
  Added in v.1.423

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26