Do not return  globalized var. Sorry oop guys!

Signed-off-by: Suki <suki@missallsunday.com>
Move the is_dir and real_path inside the while

Signed-off-by: Suki <suki@missallsunday.com>
Make sure its an int

Signed-off-by: Suki <suki@missallsunday.com>
Redundant code.

Signed-off-by: Suki <suki@missallsunday.com>
Send the default case to the bottom.

Signed-off-by: Suki <suki@missallsunday.com>
Be consistent

Signed-off-by: Suki <suki@missallsunday.com>