Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.193
 
1.194
 
MAIN:gmcgarry:20140604064349
 
cpp.c
_>447447 static int
 448448 fsrch_macos_framework(const usch *fn, const usch *dir)
 449449 {
<>450 -        static usch *current_path = NULL;
 451 -        usch *saved_path = current_path;
 452 -
453450         usch *saved_stringbuf = stringbuf;
 454451         usch *s = (usch *)strchr((const char*)fn, '/');
<> 452+        usch *nm;
  453+        usch *p;
  454+        int len  = s - fn;
455455 
<>456 -        if (s != NULL) {
 457 -                usch *nm;
 458 -                int len  = s - fn;
  456+        if (s == NULL)
  457+                return 0;
459458 
<>460 -                current_path = savstr(dir);
 461 -                stringbuf = savstr(fn) + len;
 462 -                savstr((const usch*)".framework/Frameworks/");
  459+//      fprintf(stderr, "searching for %s in %s\n", (const char *)fn, (const char *)dir);
  460+
  461+        nm = savstr(dir);
  462+        savch(0);
  463+        p = savstr(fn);
  464+        stringbuf = p + len;
  465+        savch(0);
  466+//      fprintf(stderr, "comparing \"%s\" against \"%.*s\"\n", nm, len, fn);
  467+        p = (usch *)strstr((const char *)nm, (const char *)p);
  468+//      fprintf(stderr, "p = %s\n", (const char *)p);
  469+        if (p != NULL) {
  470+                stringbuf = p;
463471                 savch(0);
<> 472+                return fsrch_macos_framework(fn, nm);
  473+        }
464474 
<>465 -                nm = savstr(dir);
 466 -                stringbuf = savstr(fn) + len;
 467 -                savstr((const usch*)".framework/Headers");
 468 -                savstr(s); savch(0);
 469 -                if (pushfile(nm, fn, SYSINC, NULL) == 0)
 470 -                        return 1;
  475+        p = nm + strlen((char *)nm) - 1;
  476+        while (*p == '/')
  477+                p--;
  478+        while (*p != '/')
  479+                p--;
  480+        stringbuf = ++p;
  481+        savstr((const usch *)"Frameworks/");
  482+        stringbuf = savstr(fn) + len;
  483+        savstr((const usch*)".framework/Headers");
  484+        savstr(s);
  485+        savch(0);
471486 
<>472 -                current_path = NULL;
  487+//      fprintf(stderr, "nm: %s\n", nm);
473488 
<>474 -                if (saved_path != NULL) {
 475 -                        if (fsrch_macos_framework(fn, saved_path))
 476 -                                return 1;
 477 -                }
 478 -        }
  489+        if (pushfile(nm, fn, SYSINC, NULL) == 0)
  490+                return 1;
  491+//      fprintf(stderr, "not found %s, continuing...\n", nm);
479492 
 480493         stringbuf = saved_stringbuf;
<>481 -        current_path = saved_path;
482494 
 483495         return 0;
 484496 }
     
 !
513525          * On MacOS, we may have to do some clever stuff
 514526          * to resolve framework headers.
 515527          */
<>516 -        if (fsrch_macos_framework(fn, (const usch *)"/Library/Frameworks/") == 1)
 517 -                return 1;
 518 -        if (fsrch_macos_framework(fn, (const usch *)"/System/Library/Frameworks/") == 1)
 519 -                return 1;
  528+        {
  529+                usch *dir = stringbuf;
  530+                savstr(ifiles->orgfn);
  531+                stringbuf = (usch *)strrchr((char *)dir, '/');
  532+                if (stringbuf != NULL) {
  533+                        stringbuf++;
  534+                        savch(0);
  535+                        if (fsrch_macos_framework(fn, dir) == 1)
  536+                                return 1;
  537+                }
  538+                stringbuf = dir;
  539+
  540+                if (fsrch_macos_framework(fn, (const usch *)"/Library/Frameworks/") == 1)
  541+                        return 1;
  542+
  543+                if (fsrch_macos_framework(fn, (const usch *)"/System/Library/Frameworks/") == 1)
  544+                        return 1;
  545+        }
<_520546 #endif
 521547 
 522548         return 0;
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-23 21:49 +0200