]> granicus.if.org Git - php/commitdiff
- Added phpdbg_is_empty function
authorFelipe Pena <felipensp@gmail.com>
Tue, 12 Nov 2013 02:50:15 +0000 (00:50 -0200)
committerFelipe Pena <felipensp@gmail.com>
Tue, 12 Nov 2013 02:50:15 +0000 (00:50 -0200)
phpdbg_prompt.c
phpdbg_utils.c
phpdbg_utils.h

index 5fd07125228fc02b4af1f9f693047d7b56d383c3..b71bd3d8203e754a2edec2f83b8205a3644bb59d 100644 (file)
@@ -498,7 +498,7 @@ static PHPDBG_COMMAND(quiet) { /* {{{ */
 
 static PHPDBG_COMMAND(list) /* {{{ */
 {
-       if (phpdbg_is_numeric(expr)) {
+       if (phpdbg_is_empty(expr) || phpdbg_is_numeric(expr)) {
                long offset = 0, count = strtol(expr, NULL, 0);
                const char *filename = PHPDBG_G(exec);
 
index 4991d3d9e5f927a9c862604bfc7016b259f586f8..e3408ed47e7ff6019714692bcd0bb9f9f3d10707 100644 (file)
@@ -30,3 +30,14 @@ int phpdbg_is_numeric(const char *str) /* {{{ */
        }
        return 0;
 } /* }}} */
+
+int phpdbg_is_empty(const char *str) /* {{{ */
+{
+       for (; *str; str++) {
+               if (isspace(*str)) {
+                       continue;
+               }
+               return 0;
+       }
+       return 1;
+} /* }}} */
index 231a1b3f216c593ae637798ae3d0d58576ae84ef..3cb430f0594be0d5d0bc2b0cd93aa2c87eecf5a7 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef PHPDBG_UTILS_H
 #define PHPDBG_UTILS_H
 
-int phpdbg_is_numeric(const char *);
+int phpdbg_is_numeric(const char*);
+int phpdbg_is_empty(const char*);
 
 #endif /* PHPDBG_UTILS_H */