PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - lcov_data/ext/phar - phar_path_check.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 33 44 75.0 %
Date: 2014-04-08 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Generated by re2c 0.13.5 on Fri Feb 25 04:29:05 2011 */
       2             : #line 1 "ext/phar/phar_path_check.re"
       3             : /*
       4             :   +----------------------------------------------------------------------+
       5             :   | phar php single-file executable PHP extension                        |
       6             :   +----------------------------------------------------------------------+
       7             :   | Copyright (c) 2007-2013 The PHP Group                                |
       8             :   +----------------------------------------------------------------------+
       9             :   | This source file is subject to version 3.01 of the PHP license,      |
      10             :   | that is bundled with this package in the file LICENSE, and is        |
      11             :   | available through the world-wide-web at the following url:           |
      12             :   | http://www.php.net/license/3_01.txt.                                 |
      13             :   | If you did not receive a copy of the PHP license and are unable to   |
      14             :   | obtain it through the world-wide-web, please send a note to          |
      15             :   | license@php.net so we can mail you a copy immediately.               |
      16             :   +----------------------------------------------------------------------+
      17             :   | Authors: Marcus Boerger <helly@php.net>                              |
      18             :   +----------------------------------------------------------------------+
      19             : */
      20             : 
      21             : /* $Id$ */
      22             : 
      23             : #include "phar_internal.h"
      24             : 
      25             : phar_path_check_result phar_path_check(char **s, int *len, const char **error)
      26             : {
      27             :         const unsigned char *p = (const unsigned char*)*s;
      28             :         const unsigned char *m;
      29             : 
      30             :         if (*len == 1 && *p == '.') {
      31             :                 *error = "current directory reference";
      32             :                 return pcr_err_curr_dir;
      33             :         } else if (*len == 2 && p[0] == '.' && p[1] == '.') {
      34             :                 *error = "upper directory reference";
      35             :                 return pcr_err_up_dir;
      36             :         }
      37             : 
      38             : #define YYCTYPE         unsigned char
      39             : #define YYCURSOR        p
      40             : #define YYLIMIT         p+*len
      41             : #define YYMARKER        m
      42             : #define YYFILL(n)
      43             : 
      44             : loop:
      45             : 
      46             : #line 47 "ext/phar/phar_path_check.c"
      47             : {
      48             :         YYCTYPE yych;
      49             : 
      50      247995 :         if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
      51      247995 :         yych = *YYCURSOR;
      52      247995 :         if (yych <= '.') {
      53       13825 :                 if (yych <= '\n') {
      54       12392 :                         if (yych <= 0x00) goto yy13;
      55           0 :                         if (yych <= '\t') goto yy10;
      56           0 :                         goto yy12;
      57             :                 } else {
      58        1433 :                         if (yych <= 0x19) goto yy10;
      59        1433 :                         if (yych == '*') goto yy6;
      60        1433 :                         goto yy15;
      61             :                 }
      62             :         } else {
      63      234170 :                 if (yych <= '?') {
      64       56446 :                         if (yych <= '/') goto yy2;
      65       30768 :                         if (yych <= '>') goto yy15;
      66           4 :                         goto yy8;
      67             :                 } else {
      68      177724 :                         if (yych == '\\') goto yy4;
      69      177724 :                         if (yych <= 0x7F) goto yy15;
      70           0 :                         goto yy10;
      71             :                 }
      72             :         }
      73             : yy2:
      74       25678 :         yych = *(YYMARKER = ++YYCURSOR);
      75       25678 :         if (yych <= '-') goto yy3;
      76       25671 :         if (yych <= '.') goto yy16;
      77       25664 :         if (yych <= '/') goto yy18;
      78             : yy3:
      79             : #line 93 "ext/phar/phar_path_check.re"
      80             :         {
      81             :                         goto loop;
      82             :                 }
      83             : #line 84 "ext/phar/phar_path_check.c"
      84             : yy4:
      85           0 :         ++YYCURSOR;
      86             : #line 60 "ext/phar/phar_path_check.re"
      87             :         {
      88             :                         *error = "back-slash";
      89             :                         return pcr_err_back_slash;
      90             :                 }
      91             : #line 92 "ext/phar/phar_path_check.c"
      92             : yy6:
      93           0 :         ++YYCURSOR;
      94             : #line 64 "ext/phar/phar_path_check.re"
      95             :         {
      96             :                         *error = "star";
      97             :                         return pcr_err_star;
      98             :                 }
      99             : #line 100 "ext/phar/phar_path_check.c"
     100             : yy8:
     101           4 :         ++YYCURSOR;
     102             : #line 68 "ext/phar/phar_path_check.re"
     103             :         {
     104             :                         if (**s == '/') {
     105             :                                 (*s)++;
     106             :                         }
     107             :                         *len = (p - (const unsigned char*)*s) -1;
     108             :                         *error = NULL;
     109             :                         return pcr_use_query;
     110             :                 }
     111             : #line 112 "ext/phar/phar_path_check.c"
     112             : yy10:
     113           0 :         ++YYCURSOR;
     114             : yy11:
     115             : #line 76 "ext/phar/phar_path_check.re"
     116             :         {
     117             :                         *error ="illegal character";
     118             :                         return pcr_err_illegal_char;
     119             :                 }
     120             : #line 121 "ext/phar/phar_path_check.c"
     121             : yy12:
     122           0 :         yych = *++YYCURSOR;
     123           0 :         goto yy11;
     124             : yy13:
     125       12392 :         ++YYCURSOR;
     126             : #line 80 "ext/phar/phar_path_check.re"
     127             :         {
     128             :                         if (**s == '/') {
     129             :                                 (*s)++;
     130             :                                 (*len)--;
     131             :                         }
     132             :                         if ((p - (const unsigned char*)*s) - 1 != *len)
     133             :                         {
     134             :                                 *error ="illegal character";
     135             :                                 return pcr_err_illegal_char;
     136             :                         }
     137             :                         *error = NULL;
     138             :                         return pcr_is_ok;
     139             :                 }
     140             : #line 141 "ext/phar/phar_path_check.c"
     141             : yy15:
     142      209921 :         yych = *++YYCURSOR;
     143      209921 :         goto yy3;
     144             : yy16:
     145           7 :         yych = *++YYCURSOR;
     146           7 :         if (yych <= 0x00) goto yy21;
     147           7 :         if (yych <= '-') goto yy17;
     148           7 :         if (yych <= '.') goto yy20;
     149           2 :         if (yych <= '/') goto yy21;
     150             : yy17:
     151           2 :         YYCURSOR = YYMARKER;
     152           2 :         goto yy3;
     153             : yy18:
     154           2 :         ++YYCURSOR;
     155             : #line 48 "ext/phar/phar_path_check.re"
     156             :         {
     157             :                         *error = "double slash";
     158             :                         return pcr_err_double_slash;
     159             :                 }
     160             : #line 161 "ext/phar/phar_path_check.c"
     161             : yy20:
     162           5 :         yych = *++YYCURSOR;
     163           5 :         if (yych <= 0x00) goto yy23;
     164           0 :         if (yych == '/') goto yy23;
     165           0 :         goto yy17;
     166             : yy21:
     167           0 :         ++YYCURSOR;
     168             : #line 56 "ext/phar/phar_path_check.re"
     169             :         {
     170             :                         *error = "current directory reference";
     171             :                         return pcr_err_curr_dir;
     172             :                 }
     173             : #line 174 "ext/phar/phar_path_check.c"
     174             : yy23:
     175           5 :         ++YYCURSOR;
     176             : #line 52 "ext/phar/phar_path_check.re"
     177             :         {
     178             :                         *error = "upper directory reference";
     179             :                         return pcr_err_up_dir;
     180             :                 }
     181             : #line 182 "ext/phar/phar_path_check.c"
     182             : }
     183             : #line 96 "ext/phar/phar_path_check.re"
     184             : 
     185             : }

Generated by: LCOV version 1.10

Generated at Tue, 08 Apr 2014 11:59:50 +0000 (8 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.