*** libwww2/HTGopher.c Tue Jan 10 17:03:49 1995 --- libwww2/HTGopher.c.new Thu Apr 6 10:58:29 1995 *************** *** 556,561 **** --- 556,563 ---- char gtype; /* Gopher Node type */ char * selector; /* Selector string */ int rv = 0; + /* AWT: proxy flag */ + int proxy = 0; if (!acceptable_inited) init_acceptable(); *************** *** 572,581 **** char * p1 = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION); gtype = '1'; /* Default = menu */ selector = p1; if ((*selector++=='/') && (*selector)) ! { /* Skip first slash */ ! gtype = *selector++; /* Pick up gtype */ } if (gtype == GOPHER_INDEX) { char * query; --- 574,595 ---- char * p1 = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION); gtype = '1'; /* Default = menu */ selector = p1; + /* CJN Bugfix for proxy gopher access if ((*selector++=='/') && (*selector)) ! { ! gtype = *selector++; } + */ + if ((*selector++=='/') && (*selector) ) { + if( !(strstr(selector,"proxy")) ) + gtype = *selector++; /* Skip first slash, Pick up gtype */ + else { + sscanf(p1,"//proxy/gopher://%*[^/]/%c", >ype); + proxy = 1; + } + } + /* CJN End Mod */ + if (gtype == GOPHER_INDEX) { char * query; *************** *** 587,600 **** display_index(arg, anAnchor); /* Display "cover page" */ return HT_LOADED; /* Local function only */ } ! *query++ = 0; /* Skip '?' */ ! HTUnEscape (query); ! command = malloc(strlen(selector)+ 1 + strlen(query)+ 2 + 1); ! de_escape(command, selector); ! strcat(command, "\t"); ! strcat(command, query); } else if (gtype == GOPHER_CSO) { --- 601,625 ---- display_index(arg, anAnchor); /* Display "cover page" */ return HT_LOADED; /* Local function only */ } ! ! /* AWT: Proxy fixed */ ! /* don't extract query and put "\t" command for a proxy */ ! if (!proxy) { ! *query++ = 0; /* Skip '?' */ ! HTUnEscape (query); ! command = malloc(strlen(selector)+ 1 + strlen(query)+ 2 + 1); ! de_escape(command, selector); ! strcat(command, "\t"); ! strcat(command, query); ! } else { ! /* do not extract query here */ ! command = malloc(strlen(selector)+2+1); ! strcpy(command, selector); ! } ! /* AWT: Proxy fixed End*/ ! } else if (gtype == GOPHER_CSO) { *************** *** 607,625 **** display_cso(arg, anAnchor); /* Display "cover page" */ return HT_LOADED; /* Local function only */ } ! *query++ = 0; /* Skip '?' */ ! HTUnEscape (query); ! command = malloc(strlen("query")+ 1 + strlen(query)+ 2 + 1); ! de_escape(command, selector); ! strcpy(command, "query "); ! strcat(command, query); } else { /* Not index */ command = malloc(strlen(selector)+2+1); ! de_escape(command, selector); } free(p1); } --- 632,666 ---- display_cso(arg, anAnchor); /* Display "cover page" */ return HT_LOADED; /* Local function only */ } ! ! /* AWT: Proxy fixed */ ! /* don't extract query and put "query" command for a proxy */ ! if (!proxy) { ! *query++ = 0; /* Skip '?' */ ! HTUnEscape (query); ! command = malloc(strlen("query")+ 1 + strlen(query)+ 2 + 1); ! de_escape(command, selector); ! strcpy(command, "query "); ! strcat(command, query); ! } else { ! command = malloc(strlen(selector)+2+1); ! strcpy(command, selector); ! } ! /* AWT: Proxy fixed End*/ ! } else { /* Not index */ command = malloc(strlen(selector)+2+1); ! /* AWT: Proxy fixed */ ! /* don't de_escape for proxy */ ! if (!proxy) ! de_escape(command, selector); ! else ! strcpy(command, selector); ! /* AWT: Proxy fixed End*/ } free(p1); }