jasonusa / webgrind

Automatically exported from code.google.com/p/webgrind
Other
0 stars 0 forks source link

Preprocessor generates incorrect function name for names with spaces #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Anything like " fn=require::F:\My Documents\My
Web\running_local\system\class\user.php " in the cahcegrind file.
2.
3.

What is the expected output? What do you see instead?
I would expect the entire filename to make it into the function name. 
Otherwise all of the require statements get lumped together.

What version of the product are you using? On what operating system?
1.0
Windows XP, Apache 2.2, PHP 5.2.6

Please provide any additional information below.
The issue here is the line:
http://code.google.com/p/webgrind/source/browse/trunk/library/Preprocessor.php#6
4

This line is using %s to get the string and this seems to be balking at the
spaces.  This can be fixed by doing the following:

list($function) = fscanf($in,"fn=%[a-zA-Z0-9,. _:\>%^{}-]");

Note that I have included all the odd punctuations because they appear in
my file names.  Not sure if there is a performance penalty for this, but it
generates the correct result.

Original issue reported on code.google.com by gexma...@gmail.com on 15 Apr 2009 at 5:18

GoogleCodeExporter commented 8 years ago
Thank you for the report, and the suggested fix.

Original comment by oett...@gmail.com on 28 Jul 2009 at 11:25

GoogleCodeExporter commented 8 years ago
Fixed in r154.

Ended up using:

list($function) = fscanf($in,"fn=%[^\n]s");

Original comment by oett...@gmail.com on 30 Jul 2009 at 8:14