Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Deleted unnecessary piece of code #10

Closed
wants to merge 1 commit into from

2 participants

@genesis19

This piece of code will never happen

@genesis19 genesis19 Deleted unnecessary piece of code
This piece of code will never happen
002106d
@vrana
Owner

It happens at the end of the query.

@vrana vrana closed this
@genesis19

I think that this mistake could be simplified to

$true = true;
if (!$true) {
   //$true is falsy
} else {
    //$true is not falsy, which means that the next line will fail (evaluate to false)
    if (!$true) {
       //this will never happen
    } 
}  

Am I completely wrong?

@vrana
Owner

(!$found && $fp && !feof($fp)) is not the same as (!$found && rtrim($query) == "").

@genesis19

Damn I feel stupid, didn't look at the rest of if statement. Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2011
  1. @genesis19

    Deleted unnecessary piece of code

    genesis19 authored
    This piece of code will never happen
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 3 deletions.
  1. +0 −3  adminer/sql.inc.php
View
3  adminer/sql.inc.php
@@ -67,9 +67,6 @@
$query .= fread($fp, 1e5);
} else {
$offset = $match[0][1] + strlen($found);
- if (!$found && rtrim($query) == "") {
- break;
- }
if ($found && $found != $delimiter) { // find matching quote or comment end
while (preg_match('(' . ($found == '/*' ? '\\*/' : ($found == '[' ? ']' : (ereg('^-- |^#', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
$s = $match[0][0];
Something went wrong with that request. Please try again.