~ubuntu-branches/ubuntu/jaunty/edbrowse/jaunty

« back to all changes in this revision

Viewing changes to jsloc.c

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2007-12-05 10:39:04 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20071205103904-zr3kzzu0ym6stg16
Tags: 3.3.1-1
* New upstream version (3.3.1).
  - Messages have been internationalised.
  - Supports LANG environment variable.
  - Includes man page.
* Incorporate upstream man page:
  - debian/rules: Add rule to install upstream man page.
  - debian/edbrowse.1: Not required. Removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
    else
212
212
        strcpy(urlbuffer, hostname);
213
213
    if(strlen(urlbuffer) >= sizeof (urlbuffer))
214
 
        errorPrint("@hostname:port is too long");
 
214
        i_printfExit(MSG_PortTooLong);
215
215
    v = STRING_TO_JSVAL(JS_NewStringCopyZ(jcx, urlbuffer));
216
216
    JS_SetProperty(jcx, uo, "host", &v);
217
217
    setter_suspend = false;
434
434
    if(s = getProtURL(url)) {
435
435
        sprintf(urlbuffer, "%s:", s);
436
436
        if(strlen(urlbuffer) >= sizeof (urlbuffer))
437
 
            errorPrint("@protocol: is too long");
 
437
            i_printfExit(MSG_ProtTooLong);
438
438
        s = urlbuffer;
439
439
    }
440
440
    loc_def_set("protocol", s, setter_loc_prot, attr);
458
458
        if(pl)
459
459
            sprintf(urlbuffer + strlen(urlbuffer), ":%d", port);
460
460
        if(strlen(urlbuffer) >= sizeof (urlbuffer))
461
 
            errorPrint("@hostname:port is too long");
 
461
            i_printfExit(MSG_PortTooLong);
462
462
        s = urlbuffer;
463
463
    }
464
464
    loc_def_set("host", s, setter_loc_host, attr);
837
837
    return JSVAL_TO_BOOLEAN(v);
838
838
}                               /* get_property_bool */
839
839
 
 
840
const char *
 
841
get_property_option(void *jv)
 
842
{
 
843
    JSObject *obj = jv;
 
844
    jsval v;
 
845
    JSObject *oa;               /* option array */
 
846
    JSObject *oo;               /* option object */
 
847
    int n;
 
848
 
 
849
    if(!obj)
 
850
        return 0;
 
851
    JS_GetProperty(jcx, obj, "selectedIndex", &v);
 
852
    n = JSVAL_TO_INT(v);
 
853
    if(n < 0)
 
854
        return 0;
 
855
    JS_GetProperty(jcx, obj, "options", &v);
 
856
    oa = JSVAL_TO_OBJECT(v);
 
857
    JS_GetElement(jcx, oa, n, &v);
 
858
    oo = JSVAL_TO_OBJECT(v);
 
859
    return get_property_string(oo, "value");
 
860
}                               /* get_property_option */
 
861
 
840
862
 
841
863
/*********************************************************************
842
864
Manage the array of options under an html select.