]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/edit.c
Attempt to fix bat seg faults
[bacula/bacula] / bacula / src / lib / edit.c
index 480253920fb337ec8c61445f8b59ec36abff8ecb..8b13435f5fa62726ff20864edffe8dbabe8cfc98 100644 (file)
@@ -406,6 +406,27 @@ bool is_a_number(const char *n)
    return digit_seen && *n==0;
 }
 
+/*
+ * Check if specified string is a list of number or not
+ */
+bool is_a_number_list(const char *n)
+{
+   bool previous_digit = false; 
+   bool digit_seen = 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 the specified string is an integer
  */