[xdebug-dev] xdebug xdebug/usefulstuff.c thingy is used.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Thu, 26 Aug 2004 11:18:56 +0200

Date: Thu Aug 26 11:18:55 CEST 2004
User: Derick Rethans
Directory: xdebug

Log Message:
- Apply Rasmus' patch to redo the path resolving in case his SKIP_PATH_CHECK
  thingy is used.

Modified files:
           xdebug/usefulstuff.c (version: 1.20)

[FILE: /xdebug/usefulstuff.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- xdebug/usefulstuff.c:1.19 Sat Jul 10 10:56:04 2004 GMT
+++ xdebug/usefulstuff.c Thu Aug 26 07:18:55 2004 GMT
@@ -293,8 +293,27 @@
         /* encode the url */
         encoded_fileurl = xdebug_raw_url_encode(fileurl, strlen(fileurl), &new_len, 1);
 
- if (fileurl[1] == '/' || fileurl[1] == '\\') {
- /* we assume the first char is a slash as well, what else could it be? */
+ if (fileurl[0] != '/' && fileurl[0] != '\\') {
+ cwd_state new_state;
+ char cwd[MAXPATHLEN];
+ char *result;
+
+ result = VCWD_GETCWD(cwd, MAXPATHLEN);
+ if (!result) {
+ cwd[0] = '\0';
+ }
+
+ new_state.cwd = strdup(cwd);
+ new_state.cwd_length = strlen(cwd);
+
+ if(!virtual_file_ex(&new_state, fileurl, NULL, 1)) {
+ char *s = estrndup(new_state.cwd, new_state.cwd_length);
+ tmp = xdebug_sprintf("file://%s",s);
+ efree(s);
+ }
+ free(new_state.cwd);
+
+ } else if (fileurl[1] == '/' || fileurl[1] == '\\') {
                 tmp = xdebug_sprintf("file:/%s", encoded_fileurl);
         } else if (fileurl[0] == '/' || fileurl[0] == '\\') {
                 tmp = xdebug_sprintf("file://%s", encoded_fileurl);
Received on Thu Aug 26 2004 - 11:19:06 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:02 BST