DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2127
Version: 1.3-feature





Link: http://www.fltk.org/str.php?L2127
Version: 1.3-feature
--- Fl_Help_View.cxx    2009-01-20 10:53:25.000000000 -0800
+++ Fl_Help_View.cxx.orig       2009-01-20 10:46:27.000000000 -0800
@@ -62,7 +62,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <FL/fl_utf8.h>
-#include <FL/filename.h>       // fl_open_uri()
 #include "flstring.h"
 #include <ctype.h>
 #include <errno.h>
@@ -3045,28 +3044,6 @@
   char         newname[1024];  // New filename buffer
 
 
-  if (strncmp(f, "ftp:", 4) == 0 ||
-      strncmp(f, "http:", 5) == 0 ||
-      strncmp(f, "https:", 6) == 0 ||
-      strncmp(f, "ipp:", 4) == 0 ||
-      strncmp(f, "mailto:";, 7) == 0 ||
-      strncmp(f, "news:";, 5) == 0) {
-    char urimsg[256];
-    if ( fl_open_uri(f, urimsg, sizeof(urimsg)) == 0 ) {
-      // Remote link wasn't resolved...
-      snprintf(error, sizeof(error),
-              "<HTML><HEAD><TITLE>Error</TITLE></HEAD>"
-              "<BODY><H1>Error</H1>"
-              "<P>Unable to follow the link \"%s\" - "
-              "%s.</P></BODY>",
-              f, urimsg);
-      value_ = strdup(error);
-      format();
-      topline(0);
-    }
-    return(0);
-  }
-
   clear_selection();
 
   strlcpy(newname, f, sizeof(newname));
@@ -3097,29 +3074,48 @@
     value_ = NULL;
   }
 
-  if (strncmp(localname, "file:", 5) == 0)
-    localname += 5;    // Adjust for local filename...
-
-  if ((fp = fl_fopen(localname, "rb")) != NULL)
-  {
-    fseek(fp, 0, SEEK_END);
-    len = ftell(fp);
-    rewind(fp);
-
-    value_ = (const char *)calloc(len + 1, 1);
-    fread((void *)value_, 1, len, fp);
-    fclose(fp);
-  }
-  else
+  if (strncmp(localname, "ftp:", 4) == 0 ||
+      strncmp(localname, "http:", 5) == 0 ||
+      strncmp(localname, "https:", 6) == 0 ||
+      strncmp(localname, "ipp:", 4) == 0 ||
+      strncmp(localname, "mailto:";, 7) == 0 ||
+      strncmp(localname, "news:";, 5) == 0)
   {
+    // Remote link wasn't resolved...
     snprintf(error, sizeof(error),
-            "<HTML><HEAD><TITLE>Error</TITLE></HEAD>"
-            "<BODY><H1>Error</H1>"
+             "<HTML><HEAD><TITLE>Error</TITLE></HEAD>"
+             "<BODY><H1>Error</H1>"
             "<P>Unable to follow the link \"%s\" - "
-            "%s.</P></BODY>",
-            localname, strerror(errno));
+            "no handler exists for this URI scheme.</P></BODY>",
+            localname);
     value_ = strdup(error);
   }
+  else
+  {
+    if (strncmp(localname, "file:", 5) == 0)
+      localname += 5;  // Adjust for local filename...
+
+    if ((fp = fl_fopen(localname, "rb")) != NULL)
+    {
+      fseek(fp, 0, SEEK_END);
+      len = ftell(fp);
+      rewind(fp);
+
+      value_ = (const char *)calloc(len + 1, 1);
+      fread((void *)value_, 1, len, fp);
+      fclose(fp);
+    }
+    else
+    {
+      snprintf(error, sizeof(error),
+               "<HTML><HEAD><TITLE>Error</TITLE></HEAD>"
+               "<BODY><H1>Error</H1>"
+              "<P>Unable to follow the link \"%s\" - "
+              "%s.</P></BODY>",
+              localname, strerror(errno));
+      value_ = strdup(error);
+    }
+  }
 
   format();
 
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to