From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <72a34a64c2fcdbba01ba7841f66e4c2d@quanstro.net> From: erik quanstrom Date: Wed, 12 Mar 2008 13:22:14 -0400 To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] abaco @ plan9port [WAS: Hi and, plan9-native abaco sources?] Topicbox-Message-UUID: 76c38492-ead3-11e9-9d60-3106f5b1d025 > > have you sent your patches to fgb? > > iru i think so. but it's been a very long time. here's the entire patch to urls.c some fixups may be required due to this fact. attached is the whole patch to urls.c. - erik // tired of typing http://, tired of going to google first. void justgoogleit(Url *u) { Rune *s; s = ucvt(u->src.r+2); free(u->src.r); u->src.r = runesmprint("http://www.google.com/search?hl=en&ie=UTF-8&q=%S", s); free(s); u->src.nr = runestrlen(u->src.r); } void addhttp(Url *u) { Rune *s; if(validurl(u->src.r)) return; s = u->src.r; u->src.r = runesmprint("http://%S", u->src.r); free(s); u->src.nr = runestrlen(u->src.r); } struct{ void (*f)(Url*); Rune *lead; int len; } ctab[] = { justgoogleit, L"g ", 2, addhttp, L"", 0, }; void urlconvience(Url *u) { int i; for(i = 0; u->src.nr >= ctab[i].len && runestrncmp(u->src.r, ctab[i].lead, ctab[i].len) != 0; i++) ; ctab[i].f(u); } int urlopen(Url *u) { char buf[BUFSIZE]; int cfd, fd, conn, n; urlconvience(u);