src/lib/edit.c
bool is_a_number_list(const char *n)
{
   bool previous_digit = false;
   bool digit_seen = false;
   if (n == NULL) {
      return false;
   }
   while (*n) {
      if (B_ISDIGIT(*n)) {
         previous_digit=true;
         digit_seen = true;
      } else if (*n == ',' && previous_digit) {
         previous_digit = false;
      } else {
         return false;
      }
      n++;
   }
   return digit_seen && *n==0;
}
/*
 * Check if specified string is a list of numbers or not
 */
Check if specified string is a list of numbers or not
Check if specified string is a list of numbers or not
bool is_a_number_list(const char *n)
{
   bool previous_digit = false;
   bool digit_seen = false;
   if (n == NULL) {
      return false;
   }
   while (*n) {
      if (B_ISDIGIT(*n)) {
         previous_digit=true;
         digit_seen = true;
      } else if (*n == ',' && previous_digit) {
         previous_digit = false;
      } else {
         return false;
      }
      n++;
   }
   return digit_seen && *n==0;
}
bool is_a_number_list ( const char * n ) { bool previous_digit = false ; bool digit_seen = false ; if ( n == NULL ) { return false ; } while ( * n ) { if ( B_ISDIGIT ( * n ) ) { previous_digit = true ; digit_seen = true ; } else if ( * n == ' ' && previous_digit ) { previous_digit = false ; } else { return false ; } n ++ ; } return digit_seen && * n == 0 ; }
Check if specified string is a list of numbers or not
Check if specified string is a list of numbers or not