mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 09:19:24 +03:00
* utilvfs.c (is_localized_month): Check "month" for NULL and
forbid punctuation characters in localized month abbreviation.
This commit is contained in:
parent
d519f9cbe8
commit
c6a4eae10c
@ -1,3 +1,8 @@
|
|||||||
|
2005-04-21 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||||
|
|
||||||
|
* utilvfs.c (is_localized_month): Check "month" for NULL and
|
||||||
|
forbid punctuation characters in localized month abbreviation.
|
||||||
|
|
||||||
2005-04-13 Roland Illig <roland.illig@gmx.de>
|
2005-04-13 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
* vfs.h: Fixed prototypes for mc_read() and mc_write(). Now they
|
* vfs.h: Fixed prototypes for mc_read() and mc_write(). Now they
|
||||||
|
@ -336,17 +336,21 @@ is_month (const char *str, struct tm *tim)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for possible locale's abbreviated month name (Jan..Dec).
|
* Check for possible locale's abbreviated month name (Jan..Dec).
|
||||||
* Any 3 bytes long string without digit and control characters.
|
* Any 3 bytes long string without digit, control and punctuation characters.
|
||||||
* isalpha() is locale specific, so it cannot be used if current
|
* isalpha() is locale specific, so it cannot be used if current
|
||||||
* locale is "C" and ftp server use Cyrillic.
|
* locale is "C" and ftp server use Cyrillic.
|
||||||
* TODO: Punctuation characters also cannot be part of month name.
|
|
||||||
* NB: It is assumed there are no whitespaces in month.
|
* NB: It is assumed there are no whitespaces in month.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
is_localized_month (const unsigned char *month)
|
is_localized_month (const unsigned char *month)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while ((i < 3) && *month && !isdigit (*month) && !iscntrl (*month)) {
|
|
||||||
|
if (!month)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
while ((i < 3) && *month && !isdigit (*month) && !iscntrl (*month)
|
||||||
|
&& !ispunct (*month)) {
|
||||||
i++;
|
i++;
|
||||||
month++;
|
month++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user