1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Merge with master

This commit is contained in:
Witold Filipczyk 2007-01-18 16:23:38 +01:00 committed by Witold Filipczyk
commit 0e0cc7100d
14 changed files with 347 additions and 311 deletions

View File

@ -49,7 +49,8 @@ dumbprefixes = {
def goto_url_hook(url):
"""Rewrite a URL that was entered in a "Go to URL" dialog box.
This function should return a URL for ELinks to follow, or None if
This function should return a string containing a URL for ELinks to
follow, or an empty string if no URL should be followed, or None if
ELinks should follow the original URL.
Arguments:
@ -63,7 +64,8 @@ def goto_url_hook(url):
def follow_url_hook(url):
"""Rewrite a URL for a link that's about to be followed.
This function should return a URL for ELinks to follow, or None if
This function should return a string containing a URL for ELinks to
follow, or an empty string if no URL should be followed, or None if
ELinks should follow the original URL.
Arguments:

View File

@ -37,7 +37,8 @@ FUNCTIONS
follow_url_hook(url)
Rewrite a URL for a link that's about to be followed.
This function should return a URL for ELinks to follow, or None if
This function should return a string containing a URL for ELinks to
follow, or an empty string if no URL should be followed, or None if
ELinks should follow the original URL.
Arguments:
@ -47,7 +48,8 @@ FUNCTIONS
goto_url_hook(url)
Rewrite a URL that was entered in a "Go to URL" dialog box.
This function should return a URL for ELinks to follow, or None if
This function should return a string containing a URL for ELinks to
follow, or an empty string if no URL should be followed, or None if
ELinks should follow the original URL.
Arguments:

599
po/fr.po

File diff suppressed because it is too large Load Diff

View File

@ -5102,9 +5102,9 @@ msgstr[2] "%ld sformatowanych"
#, c-format
msgid "%ld refreshing"
msgid_plural "%ld refreshing"
msgstr[0] "%ld od¶wie¿anych"
msgstr[1] "%ld od¶wie¿any"
msgstr[2] "%ld od¶wie¿ane"
msgstr[0] "%ld od¶wie¿any"
msgstr[1] "%ld od¶wie¿ane"
msgstr[2] "%ld od¶wie¿anych"
#: src/dialogs/info.c:236
msgid "Interlinking"

View File

@ -456,9 +456,9 @@ set_cookie(struct uri *uri, unsigned char *str)
#ifdef DEBUG_COOKIES
{
DBG("Got cookie %s = %s from %s, domain %s, "
"expires at %d, secure %d", cookie->name,
"expires at %"TIME_PRINT_FORMAT", secure %d", cookie->name,
cookie->value, cookie->server->host, cookie->domain,
cookie->expires, cookie->secure);
(time_print_T) cookie->expires, cookie->secure);
}
#endif
@ -672,8 +672,8 @@ send_cookies(struct uri *uri)
if (c->expires && c->expires <= now) {
#ifdef DEBUG_COOKIES
DBG("Cookie %s=%s (exp %d) expired.",
c->name, c->value, c->expires);
DBG("Cookie %s=%s (exp %"TIME_PRINT_FORMAT") expired.",
c->name, c->value, (time_print_T) c->expires);
#endif
delete_cookie(c);
@ -878,12 +878,12 @@ save_cookies(struct terminal *term) {
now = time(NULL);
foreach (c, cookies) {
if (!c->expires || c->expires <= now) continue;
if (secure_fprintf(ssi, "%s\t%s\t%s\t%s\t%s\t%ld\t%d\n",
if (secure_fprintf(ssi, "%s\t%s\t%s\t%s\t%s\t%"TIME_PRINT_FORMAT"\t%d\n",
c->name, c->value,
c->server->host,
empty_string_or_(c->path),
empty_string_or_(c->domain),
c->expires, c->secure) < 0)
(time_print_T) c->expires, c->secure) < 0)
break;
}

View File

@ -280,6 +280,7 @@ set_cookie_expires(struct dialog_data *dlg_data, struct widget_data *widget_data
if (!value || !cookie) return EVENT_NOT_PROCESSED;
/* Bug 923: Assumes time_t values fit in long. */
errno = 0;
number = strtol(value, (char **) &end, 10);
if (errno || *end || number < 0) return EVENT_NOT_PROCESSED;
@ -335,6 +336,7 @@ build_edit_dialog(struct terminal *term, struct cookie *cookie)
safe_strncpy(name, cookie->name, MAX_STR_LEN);
safe_strncpy(value, cookie->value, MAX_STR_LEN);
safe_strncpy(domain, cookie->domain, MAX_STR_LEN);
/* Bug 923: Assumes time_t values fit in unsigned long. */
ulongcat(expires, &length, cookie->expires, MAX_STR_LEN, 0);
length = 0;
ulongcat(secure, &length, cookie->secure, MAX_STR_LEN, 0);

View File

@ -393,10 +393,11 @@ write_global_history(void)
if (!ssi) return;
foreachback (history_item, global_history.entries) {
if (secure_fprintf(ssi, "%s\t%s\t%ld\n",
if (secure_fprintf(ssi, "%s\t%s\t%"TIME_PRINT_FORMAT"\n",
history_item->title,
history_item->url,
history_item->last_visit) < 0) break;
(time_print_T) history_item->last_visit) < 0)
break;
}
if (!secure_close(ssi)) global_history.dirty = 0;

View File

@ -760,6 +760,7 @@ parse_bittorrent_metafile(struct bittorrent_meta *meta, struct string *metafile)
break;
case BENCODING_TOKEN_CREATION_DATE:
/* Bug 923: Assumes time_t values fit in off_t. */
meta->creation_date = (time_t) parse_bencoding_integer(value);
skip_scanner_token(&scanner);
break;

View File

@ -218,6 +218,8 @@ my_timegm(struct tm *tm)
tm->tm_mon *= 153; tm->tm_mon += 2;
tm->tm_year -= 68;
/* Bug 924: Assumes all years divisible by 4 are leap years,
* even though e.g. 2100 is not. */
tm->tm_mday += tm->tm_year * 1461 / 4;
tm->tm_mday += ((tm->tm_mon / 5) - 672);

View File

@ -109,6 +109,7 @@ parse_ftp_eplf_response(struct ftp_file_info *info, unsigned char *src, int len)
case FTP_EPLF_MTIME:
if (src >= pos) break;
/* Bug 923: Assumes time_t values cannot exceed LONG_MAX. */
info->mtime = (time_t) parse_ftp_number(&src, pos, 0, LONG_MAX);
break;
case FTP_EPLF_ID:

View File

@ -150,6 +150,7 @@ smjs_globhist_item_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *
case GLOBHIST_LAST_VISIT: {
uint32 seconds;
/* Bug 923: Assumes time_t values fit in uint32. */
JS_ValueToECMAUint32(smjs_ctx, *vp, &seconds);
history_item->last_visit = seconds;

View File

@ -134,6 +134,8 @@ timeval_from_milliseconds(timeval_T *t, milliseconds_T milliseconds)
return t;
}
/* Bug 923: Assumes time_t values fit in long. (This function is used
* for both timestamps and durations.) */
timeval_T *
timeval_from_seconds(timeval_T *t, long seconds)
{
@ -184,6 +186,8 @@ timeval_to_milliseconds(timeval_T *t)
return add_ms_to_ms(a, b);
}
/* Bug 923: Assumes time_t values fit in long. (This function is used
* for both timestamps and durations.) */
long
timeval_to_seconds(timeval_T *t)
{

View File

@ -16,13 +16,20 @@ typedef long milliseconds_T;
#define ms_max(a, b) ((a) < (b) ? (b) : (a))
#define ms_min(a, b) ((a) < (b) ? (a) : (b))
/* Is using atol() in this way acceptable? It seems
* non-portable to me; time_t might not be a long. -- Miciah */
/* Bug 923: Assumes time_t values fit in long. */
#define str_to_time_t(s) ((time_t) atol(s))
/* When formatting time_t values to be parsed with str_to_time_t,
* we first cast to time_print_T and then printf the result with
* TIME_PRINT_FORMAT.
* Bug 923: Assumes time_t values fit in long. */
typedef long time_print_T;
#define TIME_PRINT_FORMAT "ld"
/* Redefine a timeval that has all fields signed so calculations
* will be simplified on rare systems that define timeval with
* unsigned fields. */
* unsigned fields.
* Bug 923: Assumes time_t values fit in long. (This structure is
* used for both timestamps and durations.) */
typedef struct { long sec; long usec; } timeval_T;
timeval_T *timeval_from_milliseconds(timeval_T *t, milliseconds_T milliseconds);