------------------------------------------------------------ revno: 116069 committer: martin rudalics branch nick: trunk timestamp: Sun 2014-01-19 10:24:26 +0100 message: In term-window-width call window-text-width instead of window-width (Bug#16470). * term.el (term-window-width): Call window-text-width instead of window-width (Bug#16470). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-01-18 22:23:38 +0000 +++ lisp/ChangeLog 2014-01-19 09:24:26 +0000 @@ -1,3 +1,8 @@ +2014-01-19 Martin Rudalics + + * term.el (term-window-width): Call window-text-width instead of + window-width (Bug#16470). + 2014-01-18 Paul Eggert * simple.el (password-word-equivalents): Remove duplicates. === modified file 'lisp/term.el' --- lisp/term.el 2014-01-01 07:43:34 +0000 +++ lisp/term.el 2014-01-19 09:24:26 +0000 @@ -975,7 +975,8 @@ (display-graphic-p) overflow-newline-into-fringe (/= (frame-parameter nil 'right-fringe) 0)) - (window-width) + ;; Call window-text-width instead of window-width (Bug#16470). + (window-text-width) (1- (window-width)))) ------------------------------------------------------------ revno: 116068 fixes bug: http://debbugs.gnu.org/16428 committer: Paul Eggert branch nick: trunk timestamp: Sun 2014-01-19 00:50:53 -0800 message: update-game-score fixes for -m and integer overflow * update-game-score.c: Include inttypes.h, stdbool.h. (min): New macro, if not already defined. (MAX_SCORES, main): Limit the maximum number of scores only from limits imposed by the underyling platform, instead of the arbitrary value 200. (struct score_entry, main, read_score, write_score): Scores are now intmax_t, not long. (get_user_id): Reject user names containing spaces or newlines, as they would mess up the score file. Allow uids that don't fit in 'long'. Increase the size of the buffer, to avoid overrun in weird cases. (get_prefix, main): Use bool for boolean. (main): Rewrite expr to avoid possibility of signed integer overflow. Don't allow newlines in data, as this would mess up the score file. Check for memory allocation failure when adding the new score, or when unlockint the file. Implement -m. (read_score): Check for integer overflow when reading a score. (read_score) [!HAVE_GETDELIM]: Check for integer overflow when data gets very long. Check only for space to delimit names, since that's what's done in the HAVE_GETDELIM case. (read_scores): New parameter ALLOC. Change counts to ptrdiff_t. All uses changed. Use push_score to add individual scores; that's simpler than repeating its contents. (score_compare_reverse): Simplify. (push_score): New parameter SIZE. Change counts to ptrdiff_t. All uses changed. Check for integer overflow of size calculation. (sort_scores, write_scores): Change counts to ptrdiff_t. (unlock_file): Preserve errno on success, so that storage exhaustion is diagnosed correctly. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-01-16 08:34:43 +0000 +++ lib-src/ChangeLog 2014-01-19 08:50:53 +0000 @@ -1,3 +1,36 @@ +2014-01-19 Paul Eggert + + update-game-score fixes for -m and integer overflow (Bug#16428) + * update-game-score.c: Include inttypes.h, stdbool.h. + (min): New macro, if not already defined. + (MAX_SCORES, main): Limit the maximum number of scores only from + limits imposed by the underyling platform, instead of the + arbitrary value 200. + (struct score_entry, main, read_score, write_score): + Scores are now intmax_t, not long. + (get_user_id): Reject user names containing spaces or newlines, + as they would mess up the score file. + Allow uids that don't fit in 'long'. + Increase the size of the buffer, to avoid overrun in weird cases. + (get_prefix, main): Use bool for boolean. + (main): Rewrite expr to avoid possibility of signed integer + overflow. Don't allow newlines in data, as this would mess up + the score file. Check for memory allocation failure when adding + the new score, or when unlockint the file. Implement -m. + (read_score): Check for integer overflow when reading a score. + (read_score) [!HAVE_GETDELIM]: Check for integer overflow when + data gets very long. Check only for space to delimit names, + since that's what's done in the HAVE_GETDELIM case. + (read_scores): New parameter ALLOC. Change counts to ptrdiff_t. + All uses changed. Use push_score to add individual scores; + that's simpler than repeating its contents. + (score_compare_reverse): Simplify. + (push_score): New parameter SIZE. Change counts to ptrdiff_t. + All uses changed. Check for integer overflow of size calculation. + (sort_scores, write_scores): Change counts to ptrdiff_t. + (unlock_file): Preserve errno on success, so that storage + exhaustion is diagnosed correctly. + 2014-01-05 Paul Eggert Spelling fixes. === modified file 'lib-src/update-game-score.c' --- lib-src/update-game-score.c 2014-01-01 07:43:34 +0000 +++ lib-src/update-game-score.c 2014-01-19 08:50:53 +0000 @@ -35,7 +35,9 @@ #include #include +#include #include +#include #include #include #include @@ -50,8 +52,11 @@ #include "ntlib.h" #endif +#ifndef min +# define min(a,b) ((a) < (b) ? (a) : (b)) +#endif + #define MAX_ATTEMPTS 5 -#define MAX_SCORES 200 #define MAX_DATA_LEN 1024 #ifndef HAVE_DIFFTIME @@ -76,18 +81,21 @@ struct score_entry { - long score; + intmax_t score; char *username; char *data; }; +#define MAX_SCORES min (PTRDIFF_MAX, SIZE_MAX / sizeof (struct score_entry)) + static int read_scores (const char *filename, struct score_entry **scores, - int *count); -static int push_score (struct score_entry **scores, int *count, - int newscore, char *username, char *newdata); -static void sort_scores (struct score_entry *scores, int count, int reverse); + ptrdiff_t *count, ptrdiff_t *alloc); +static int push_score (struct score_entry **scores, ptrdiff_t *count, + ptrdiff_t *size, struct score_entry const *newscore); +static void sort_scores (struct score_entry *scores, ptrdiff_t count, + bool reverse); static int write_scores (const char *filename, - const struct score_entry *scores, int count); + const struct score_entry *scores, ptrdiff_t count); static _Noreturn void lose (const char *msg) @@ -107,19 +115,19 @@ get_user_id (void) { struct passwd *buf = getpwuid (getuid ()); - if (!buf) + if (!buf || strchr (buf->pw_name, ' ') || strchr (buf->pw_name, '\n')) { - long uid = getuid (); - char *name = malloc (sizeof uid * CHAR_BIT / 3 + 1); + intmax_t uid = getuid (); + char *name = malloc (sizeof uid * CHAR_BIT / 3 + 4); if (name) - sprintf (name, "%ld", uid); + sprintf (name, "%"PRIdMAX, uid); return name; } return buf->pw_name; } static const char * -get_prefix (int running_suid, const char *user_prefix) +get_prefix (bool running_suid, const char *user_prefix) { if (!running_suid && user_prefix == NULL) lose ("Not using a shared game directory, and no prefix given."); @@ -137,14 +145,18 @@ int main (int argc, char **argv) { - int c, running_suid; + int c; + bool running_suid; void *lockstate; - char *user_id, *scorefile; + char *scorefile; + char *nl; const char *prefix, *user_prefix = NULL; struct stat buf; struct score_entry *scores; - int newscore, scorecount, reverse = 0, max = MAX_SCORES; - char *newdata; + struct score_entry newscore; + bool reverse = false; + ptrdiff_t scorecount, scorealloc; + ptrdiff_t max_scores = MAX_SCORES; srand (time (0)); @@ -161,15 +173,18 @@ reverse = 1; break; case 'm': - max = atoi (optarg); - if (max > MAX_SCORES) - max = MAX_SCORES; + { + intmax_t m = strtoimax (optarg, 0, 10); + if (m < 0) + usage (EXIT_FAILURE); + max_scores = min (m, MAX_SCORES); + } break; default: usage (EXIT_FAILURE); } - if (optind+3 != argc) + if (argc - optind != 3) usage (EXIT_FAILURE); running_suid = (getuid () != geteuid ()); @@ -183,13 +198,18 @@ strcpy (scorefile, prefix); strcat (scorefile, "/"); strcat (scorefile, argv[optind]); - newscore = atoi (argv[optind+1]); - newdata = argv[optind+2]; - if (strlen (newdata) > MAX_DATA_LEN) - newdata[MAX_DATA_LEN] = '\0'; - - user_id = get_user_id (); - if (user_id == NULL) + + newscore.score = strtoimax (argv[optind + 1], 0, 10); + + newscore.data = argv[optind + 2]; + if (strlen (newscore.data) > MAX_DATA_LEN) + newscore.data[MAX_DATA_LEN] = '\0'; + nl = strchr (newscore.data, '\n'); + if (nl) + *nl = '\0'; + + newscore.username = get_user_id (); + if (! newscore.username) lose_syserr ("Couldn't determine user id"); if (stat (scorefile, &buf) < 0) @@ -198,29 +218,34 @@ if (lock_file (scorefile, &lockstate) < 0) lose_syserr ("Failed to lock scores file"); - if (read_scores (scorefile, &scores, &scorecount) < 0) + if (read_scores (scorefile, &scores, &scorecount, &scorealloc) < 0) { unlock_file (scorefile, lockstate); lose_syserr ("Failed to read scores file"); } - push_score (&scores, &scorecount, newscore, user_id, newdata); + if (push_score (&scores, &scorecount, &scorealloc, &newscore) < 0) + { + unlock_file (scorefile, lockstate); + lose_syserr ("Failed to add score"); + } sort_scores (scores, scorecount, reverse); /* Limit the number of scores. If we're using reverse sorting, then also increment the beginning of the array, to skip over the *smallest* scores. Otherwise, just decrementing the number of scores suffices, since the smallest is at the end. */ - if (scorecount > MAX_SCORES) + if (scorecount > max_scores) { if (reverse) - scores += (scorecount - MAX_SCORES); - scorecount = MAX_SCORES; + scores += scorecount - max_scores; + scorecount = max_scores; } if (write_scores (scorefile, scores, scorecount) < 0) { unlock_file (scorefile, lockstate); lose_syserr ("Failed to write scores file"); } - unlock_file (scorefile, lockstate); + if (unlock_file (scorefile, lockstate) < 0) + lose_syserr ("Failed to unlock scores file"); exit (EXIT_SUCCESS); } @@ -234,8 +259,12 @@ return 1; for (score->score = 0; (c = getc (f)) != EOF && isdigit (c); ) { + if (INTMAX_MAX / 10 < score->score) + return -1; score->score *= 10; - score->score += (c-48); + if (INTMAX_MAX - (c - '0') < score->score) + return -1; + score->score += c - '0'; } while ((c = getc (f)) != EOF && isspace (c)) @@ -254,18 +283,30 @@ } #else { - int unameread = 0; - int unamelen = 30; + ptrdiff_t unameread = 0; + ptrdiff_t unamelen = 30; char *username = malloc (unamelen); if (!username) return -1; - while ((c = getc (f)) != EOF - && !isspace (c)) + while ((c = getc (f)) != EOF && c != ' ') { - if (unameread >= unamelen-1) - if (!(username = realloc (username, unamelen *= 2))) - return -1; + if (unameread >= unamelen - 1) + { + ptrdiff_t unamelen_max = min (PTRDIFF_MAX, SIZE_MAX); + if (unamelen <= unamelen_max / 2) + unamelen *= 2; + else if (unamelen < unamelen_max) + unamelen = unamelen_max; + else + { + errno = ENOMEM; + return -1; + } + username = realloc (username, unamelen); + if (!username) + return -1; + } username[unameread] = c; unameread++; } @@ -286,8 +327,8 @@ } #else { - int cur = 0; - int len = 16; + ptrdiff_t cur = 0; + ptrdiff_t len = 16; char *buf = malloc (len); if (!buf) return -1; @@ -296,6 +337,11 @@ { if (cur >= len-1) { + if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < len) + { + errno = ENOMEM; + return -1; + } if (!(buf = realloc (buf, len *= 2))) return -1; } @@ -310,35 +356,25 @@ } static int -read_scores (const char *filename, struct score_entry **scores, int *count) +read_scores (const char *filename, struct score_entry **scores, + ptrdiff_t *count, ptrdiff_t *alloc) { - int readval = -1, scorecount, cursize; - struct score_entry *ret; + int readval = -1; + ptrdiff_t scorecount = 0; + ptrdiff_t cursize = 0; + struct score_entry *ret = 0; + struct score_entry entry; FILE *f = fopen (filename, "r"); int retval = -1; if (!f) return -1; - scorecount = 0; - cursize = 16; - ret = (struct score_entry *) malloc (sizeof (struct score_entry) * cursize); - if (ret) - { - while ((readval = read_score (f, &ret[scorecount])) == 0) - { - scorecount++; - if (scorecount >= cursize) - { - cursize *= 2; - ret = (struct score_entry *) - realloc (ret, (sizeof (struct score_entry) * cursize)); - if (!ret) - break; - } - } - } + while ((readval = read_score (f, &entry)) == 0) + if (push_score (&ret, &scorecount, &cursize, &entry) < 0) + return -1; if (readval > 0) { *count = scorecount; + *alloc = cursize; *scores = ret; retval = 0; } @@ -357,40 +393,53 @@ static int score_compare_reverse (const void *a, const void *b) { - const struct score_entry *sa = (const struct score_entry *) a; - const struct score_entry *sb = (const struct score_entry *) b; - return (sa->score > sb->score) - (sa->score < sb->score); + return score_compare (b, a); } int -push_score (struct score_entry **scores, int *count, int newscore, char *username, char *newdata) +push_score (struct score_entry **scores, ptrdiff_t *count, ptrdiff_t *size, + struct score_entry const *newscore) { - struct score_entry *newscores - = (struct score_entry *) realloc (*scores, - sizeof (struct score_entry) * ((*count) + 1)); - if (!newscores) - return -1; - newscores[*count].score = newscore; - newscores[*count].username = username; - newscores[*count].data = newdata; + struct score_entry *newscores = *scores; + if (*count == *size) + { + ptrdiff_t newsize = *size; + if (newsize <= 0) + newsize = 1; + else if (newsize <= MAX_SCORES / 2) + newsize *= 2; + else if (newsize < MAX_SCORES) + newsize = MAX_SCORES; + else + { + errno = ENOMEM; + return -1; + } + newscores = realloc (newscores, sizeof *newscores * newsize); + if (!newscores) + return -1; + *scores = newscores; + *size = newsize; + } + newscores[*count] = *newscore; (*count) += 1; - *scores = newscores; return 0; } static void -sort_scores (struct score_entry *scores, int count, int reverse) +sort_scores (struct score_entry *scores, ptrdiff_t count, bool reverse) { - qsort (scores, count, sizeof (struct score_entry), - reverse ? score_compare_reverse : score_compare); + qsort (scores, count, sizeof *scores, + reverse ? score_compare_reverse : score_compare); } static int -write_scores (const char *filename, const struct score_entry *scores, int count) +write_scores (const char *filename, const struct score_entry *scores, + ptrdiff_t count) { int fd; FILE *f; - int i; + ptrdiff_t i; char *tempfile = malloc (strlen (filename) + strlen (".tempXXXXXX") + 1); if (!tempfile) return -1; @@ -403,8 +452,9 @@ if (! f) return -1; for (i = 0; i < count; i++) - if (fprintf (f, "%ld %s %s\n", scores[i].score, scores[i].username, - scores[i].data) < 0) + if (fprintf (f, "%"PRIdMAX" %s %s\n", + scores[i].score, scores[i].username, scores[i].data) + < 0) return -1; fclose (f); if (rename (tempfile, filename) < 0) @@ -459,10 +509,11 @@ unlock_file (const char *filename, void *state) { char *lockpath = (char *) state; + int saved_errno = errno; int ret = unlink (lockpath); - int saved_errno = errno; + int unlink_errno = errno; free (lockpath); - errno = saved_errno; + errno = ret < 0 ? unlink_errno : saved_errno; return ret; } ------------------------------------------------------------ revno: 116067 committer: Paul Eggert branch nick: trunk timestamp: Sat 2014-01-18 14:23:38 -0800 message: * simple.el (password-word-equivalents): Remove duplicates. Sort, to make this easier next time. Downcase. Omit ": " after "jelszó". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-01-18 15:11:03 +0000 +++ lisp/ChangeLog 2014-01-18 22:23:38 +0000 @@ -1,3 +1,9 @@ +2014-01-18 Paul Eggert + + * simple.el (password-word-equivalents): Remove duplicates. + Sort, to make this easier next time. + Downcase. Omit ": " after "jelszó". + 2014-01-18 Jan Djärv * term/common-win.el (saved-region-selection): Defvar it. === modified file 'lisp/simple.el' --- lisp/simple.el 2014-01-17 16:45:45 +0000 +++ lisp/simple.el 2014-01-18 22:23:38 +0000 @@ -2557,52 +2557,49 @@ (defcustom password-word-equivalents '("password" "passphrase" "pass phrase" - "كلمة السر" ; ar - "গুপ্তশব্দ" ; as - "পাসওয়ার্ড" ; bn_IN - "contrasenya" ; ca - "heslo" ; cs - "adgangskode" ; da - "passwort" ; de - "pasvorto" ; eo - "contraseña" ; es - "pasahitza" ; eu - "salasana" ; fi - "mot de passe" ; fr - "પાસવર્ડ" ; gu - "ססמה" ; he - "शब्दकूट" ; hi - "lozinka" ; hr - "Jelszó: " ; hu - "パスワード" ; ja - "Пароль" ; kk - "ಗುಪ್ತಪದ" ; kn - "암호" ; ko - "ពាក្យសម្ងាត់" ; km - "slaptažodis" ; lt - "അടയാളവാക്ക്" ; ml - "गुप्तशब्द" ; mr - "passord" ; nb - "wachtwoord" ; nl - "ପ୍ରବେଶ ସଙ୍କେତ" ; or - "ਪਾਸਵਰਡ" ; pa - "hasło" ; pl - "senha" ; pt - "Пароль" ; ru - "රහස්පදය" ; si - "Heslo" ; sk - "geslo" ; sl - "lozinka" ; sr - "Лозинка" ; sr - "lösenord" ; sv - "கடவுச்சொல்" ; ta - "సంకేతపదము" ; te - "parola" ; tr - "Пароль" ; uk - "Mật khẩu" ; vi - "密码" ; zh_CN - "密碼" ; zh_TW - "iphasiwedi" ; zu + ; These are sorted according to the GNU en_US locale. + "암호" ; ko + "パスワード" ; ja + "ପ୍ରବେଶ ସଙ୍କେତ" ; or + "ពាក្យសម្ងាត់" ; km + "adgangskode" ; da + "contraseña" ; es + "contrasenya" ; ca + "geslo" ; sl + "hasło" ; pl + "heslo" ; cs, sk + "iphasiwedi" ; zu + "jelszó" ; hu + "lösenord" ; sv + "lozinka" ; hr, sr + "mật khẩu" ; vi + "mot de passe" ; fr + "parola" ; tr + "pasahitza" ; eu + "passord" ; nb + "passwort" ; de + "pasvorto" ; eo + "salasana" ; fi + "senha" ; pt + "slaptažodis" ; lt + "wachtwoord" ; nl + "كلمة السر" ; ar + "ססמה" ; he + "лозинка" ; sr + "пароль" ; kk, ru, uk + "गुप्तशब्द" ; mr + "शब्दकूट" ; hi + "પાસવર્ડ" ; gu + "సంకేతపదము" ; te + "ਪਾਸਵਰਡ" ; pa + "ಗುಪ್ತಪದ" ; kn + "கடவுச்சொல்" ; ta + "അടയാളവാക്ക്" ; ml + "গুপ্তশব্দ" ; as + "পাসওয়ার্ড" ; bn_IN + "රහස්පදය" ; si + "密码" ; zh_CN + "密碼" ; zh_TW ) "List of words equivalent to \"password\". This is used by Shell mode and other parts of Emacs to recognize ------------------------------------------------------------ revno: 116066 author: Steinar Bang committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2014-01-18 20:46:53 +0000 message: lisp/gnus/gnus-setup.el (gnus-use-sendmail): We never use sendmail for mail reading diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-01-09 20:15:04 +0000 +++ lisp/gnus/ChangeLog 2014-01-18 20:46:53 +0000 @@ -1,3 +1,8 @@ +2014-01-18 Steinar Bang + + * gnus-setup.el (gnus-use-sendmail): We never use sendmail for mail + reading. + 2014-01-09 Ken Olum (tiny change) * message.el (message-bury): Call bury-buffer with no argument === modified file 'lisp/gnus/gnus-setup.el' --- lisp/gnus/gnus-setup.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-setup.el 2014-01-18 20:46:53 +0000 @@ -59,7 +59,7 @@ "Set this if you want to use MH-E for mail reading.") (defvar gnus-use-rmail nil "Set this if you want to use RMAIL for mail reading.") -(defvar gnus-use-sendmail t +(defvar gnus-use-sendmail nil "Set this if you want to use SENDMAIL for mail reading.") (defvar gnus-use-vm nil "Set this if you want to use the VM package for mail reading.") ------------------------------------------------------------ revno: 116065 fixes bug: http://debbugs.gnu.org/16382 committer: Jan D. branch nick: trunk timestamp: Sat 2014-01-18 16:11:03 +0100 message: * lisp/term/common-win.el (saved-region-selection): Defvar it. (x-select-text): Set saved-region-selection. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-01-18 01:29:25 +0000 +++ lisp/ChangeLog 2014-01-18 15:11:03 +0000 @@ -1,3 +1,8 @@ +2014-01-18 Jan Djärv + + * term/common-win.el (saved-region-selection): Defvar it. + (x-select-text): Set saved-region-selection (Bug#16382). + 2014-01-18 Glenn Morris * emacs-lisp/authors.el (authors-aliases) === modified file 'lisp/term/common-win.el' --- lisp/term/common-win.el 2014-01-01 07:43:34 +0000 +++ lisp/term/common-win.el 2014-01-18 15:11:03 +0000 @@ -47,6 +47,7 @@ (defvar x-select-enable-primary) ; x-win.el (defvar x-last-selected-text-primary) (defvar x-last-selected-text-clipboard) +(defvar saved-region-selection) ; simple.el (defun x-select-text (text) "Select TEXT, a string, according to the window system. @@ -77,6 +78,10 @@ (x-set-selection 'PRIMARY text) (setq x-last-selected-text-primary text)) (when x-select-enable-clipboard + ;; When cutting, the selection is cleared and PRIMARY set to + ;; the empty string. Prevent that, PRIMARY should not be reset + ;; by cut (Bug#16382). + (setq saved-region-selection text) (x-set-selection 'CLIPBOARD text) (setq x-last-selected-text-clipboard text)))))) ------------------------------------------------------------ revno: 116064 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2014-01-18 13:46:22 +0200 message: Fix file name handling on MS-Windows 9X. src/w32.c (maybe_load_unicows_dll): New function. src/emacs.c (main) [WINDOWSNT]: Call maybe_load_unicows_dll early on, to make sure we can convert file names to and from UTF-8 on Windows 9X. This fixes a failure to start up because Emacs cannot find term/w32-win.el. Reported by oslsachem . src/w32font.c [WINDOWSNT]: Include w32.h. (w32_load_unicows_or_gdi32): Call maybe_load_unicows_dll, instead of implementing the same stuff. Remove now unused g_b_init_is_windows_9x. src/w32.h (maybe_load_unicows_dll): Add prototype. nt/runemacs.c (ensure_unicows_dll): Don't tell in the message box that "emacs -nw" can do without UNICOWS.DLL on Windows 9X. See w32.c:maybe_load_unicows_dll and its callers for the reason. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2014-01-16 08:34:43 +0000 +++ nt/ChangeLog 2014-01-18 11:46:22 +0000 @@ -1,3 +1,9 @@ +2014-01-18 Eli Zaretskii + + * runemacs.c (ensure_unicows_dll): Don't tell in the message box + that "emacs -nw" can do without UNICOWS.DLL on Windows 9X. See + w32.c:maybe_load_unicows_dll and its callers for the reason. + 2014-01-11 Claudio Bley * inc/sys/stat.h (_WSTAT_DEFINED): Define, to avoid compilation === modified file 'nt/runemacs.c' --- nt/runemacs.c 2014-01-01 07:43:34 +0000 +++ nt/runemacs.c 2014-01-18 11:46:22 +0000 @@ -234,8 +234,6 @@ "Emacs cannot load the UNICOWS.DLL library.\n" "This library is essential for using Emacs\n" "on this system. You need to install it.\n\n" - "However, you can still use Emacs by invoking\n" - "it with the '-nw' command-line option.\n\n" "Emacs will exit when you click OK.", "Emacs cannot load UNICOWS.DLL", MB_ICONERROR | MB_TASKMODAL === modified file 'src/ChangeLog' --- src/ChangeLog 2014-01-18 01:51:38 +0000 +++ src/ChangeLog 2014-01-18 11:46:22 +0000 @@ -1,3 +1,20 @@ +2014-01-18 Eli Zaretskii + + Fix file name handling on MS-Windows 9X. + * w32.c (maybe_load_unicows_dll): New function. + + * emacs.c (main) [WINDOWSNT]: Call maybe_load_unicows_dll early + on, to make sure we can convert file names to and from UTF-8 on + Windows 9X. This fixes a failure to start up because Emacs cannot + find term/w32-win.el. Reported by oslsachem . + + * w32font.c [WINDOWSNT]: Include w32.h. + (w32_load_unicows_or_gdi32): Call maybe_load_unicows_dll, instead + of implementing the same stuff. + Remove now unused g_b_init_is_windows_9x. + + * w32.h (maybe_load_unicows_dll): Add prototype. + 2014-01-17 Eli Zaretskii * menu.c (Fx_popup_menu): When invoking tty_menu_show, temporarily === modified file 'src/emacs.c' --- src/emacs.c 2014-01-01 07:43:34 +0000 +++ src/emacs.c 2014-01-18 11:46:22 +0000 @@ -749,6 +749,12 @@ early as possible. (unexw32.c calls this function as well, but the additional call here is harmless.) */ cache_system_info (); +#ifdef WINDOWSNT + /* On Windows 9X, we have to load UNICOWS.DLL as early as possible, + to have non-stub implementations of APIs we need to convert file + names between UTF-8 and the system's ANSI codepage. */ + maybe_load_unicows_dll (); +#endif #endif #ifdef RUN_TIME_REMAP === modified file 'src/w32.c' --- src/w32.c 2014-01-01 07:43:34 +0000 +++ src/w32.c 2014-01-18 11:46:22 +0000 @@ -8923,6 +8923,40 @@ return FALSE; } +/* On Windows 9X, load UNICOWS.DLL and return its handle, or die. On + NT, return a handle to GDI32.DLL. */ +HANDLE +maybe_load_unicows_dll (void) +{ + if (os_subtype == OS_9X) + { + HANDLE ret = LoadLibrary ("Unicows.dll"); + if (ret) + return ret; + else + { + int button; + + button = MessageBox (NULL, + "Emacs cannot load the UNICOWS.DLL library.\n" + "This library is essential for using Emacs\n" + "on this system. You need to install it.\n\n" + "Emacs will exit when you click OK.", + "Emacs cannot load UNICOWS.DLL", + MB_ICONERROR | MB_TASKMODAL + | MB_SETFOREGROUND | MB_OK); + switch (button) + { + case IDOK: + default: + exit (1); + } + } + } + else + return LoadLibrary ("Gdi32.dll"); +} + /* globals_of_w32 is used to initialize those global variables that must always be initialized on startup even when the global variable === modified file 'src/w32.h' --- src/w32.h 2014-01-01 07:43:34 +0000 +++ src/w32.h 2014-01-18 11:46:22 +0000 @@ -163,6 +163,7 @@ extern void release_listen_threads (void); extern void init_ntproc (int); extern void term_ntproc (int); +extern HANDLE maybe_load_unicows_dll (void); extern void globals_of_w32 (void); extern void term_timers (void); === modified file 'src/w32font.c' --- src/w32font.c 2014-01-01 07:43:34 +0000 +++ src/w32font.c 2014-01-18 11:46:22 +0000 @@ -33,6 +33,9 @@ #include "fontset.h" #include "font.h" #include "w32font.h" +#ifdef WINDOWSNT +#include "w32.h" +#endif /* Cleartype available on Windows XP, cleartype_natural from XP SP1. The latter does not try to fit cleartype smoothed fonts into the @@ -144,7 +147,6 @@ style variations if the font name is not specified. */ static void list_all_matching_fonts (struct font_callback_data *); -static BOOL g_b_init_is_w9x; static BOOL g_b_init_get_outline_metrics_w; static BOOL g_b_init_get_text_metrics_w; static BOOL g_b_init_get_glyph_outline_w; @@ -183,45 +185,7 @@ static HMODULE w32_load_unicows_or_gdi32 (void) { - static BOOL is_9x = 0; - OSVERSIONINFO os_ver; - HMODULE ret; - if (g_b_init_is_w9x == 0) - { - g_b_init_is_w9x = 1; - ZeroMemory (&os_ver, sizeof (OSVERSIONINFO)); - os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - if (GetVersionEx (&os_ver)) - is_9x = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS); - } - if (is_9x) - { - ret = LoadLibrary ("Unicows.dll"); - if (!ret) - { - int button; - - button = MessageBox (NULL, - "Emacs cannot load the UNICOWS.DLL library.\n" - "This library is essential for using Emacs\n" - "on this system. You need to install it.\n\n" - "However, you can still use Emacs by invoking\n" - "it with the '-nw' command-line option.\n\n" - "Emacs will exit when you click OK.", - "Emacs cannot load UNICOWS.DLL", - MB_ICONERROR | MB_TASKMODAL - | MB_SETFOREGROUND | MB_OK); - switch (button) - { - case IDOK: - default: - exit (1); - } - } - } - else - ret = LoadLibrary ("Gdi32.dll"); - return ret; + return maybe_load_unicows_dll (); } /* The following 3 functions call the problematic "wide" APIs via @@ -2753,7 +2717,6 @@ void globals_of_w32font (void) { - g_b_init_is_w9x = 0; g_b_init_get_outline_metrics_w = 0; g_b_init_get_text_metrics_w = 0; g_b_init_get_glyph_outline_w = 0; ------------------------------------------------------------ revno: 116063 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-01-17 20:51:38 -0500 message: ChangeLog and Author: header comment fixes diff: === modified file 'lisp/org/ob-makefile.el' --- lisp/org/ob-makefile.el 2014-01-01 07:43:34 +0000 +++ lisp/org/ob-makefile.el 2014-01-18 01:51:38 +0000 @@ -2,7 +2,8 @@ ;; Copyright (C) 2009-2014 Free Software Foundation, Inc. -;; Author: Eric Schulte and Thomas S. Dye +;; Author: Eric Schulte +;; Thomas S. Dye ;; Keywords: literate programming, reproducible research ;; Homepage: http://orgmode.org === modified file 'lisp/org/ob-scheme.el' --- lisp/org/ob-scheme.el 2014-01-01 07:43:34 +0000 +++ lisp/org/ob-scheme.el 2014-01-18 01:51:38 +0000 @@ -2,7 +2,8 @@ ;; Copyright (C) 2010-2014 Free Software Foundation, Inc. -;; Authors: Eric Schulte, Michael Gauland +;; Authors: Eric Schulte +;; Michael Gauland ;; Keywords: literate programming, reproducible research, scheme ;; Homepage: http://orgmode.org === modified file 'src/ChangeLog' --- src/ChangeLog 2014-01-17 11:55:00 +0000 +++ src/ChangeLog 2014-01-18 01:51:38 +0000 @@ -8607,7 +8607,7 @@ (FRAME_SCROLL_BOTTOM_VPOS): Remove. * xdisp.c (redisplay_internal): Adjust user. -2013-03-30 Darren Ho (tiny change) +2013-03-30 Darren Hoo (tiny change) * nsmenu.m (showAtX:Y:for:): setLevel to NSPopUpMenuWindowLevel (Bug#13998). === modified file 'test/automated/eieio-test-methodinvoke.el' --- test/automated/eieio-test-methodinvoke.el 2014-01-01 07:43:34 +0000 +++ test/automated/eieio-test-methodinvoke.el 2014-01-18 01:51:38 +0000 @@ -1,9 +1,8 @@ ;;; eieio-testsinvoke.el -- eieio tests for method invocation -;; Copyright (C) 2005, 2008, 2010, 2013-2014 Free Software Foundation, -;; Inc. +;; Copyright (C) 2005, 2008, 2010, 2013-2014 Free Software Foundation, Inc. -;; Author: Eric. M. Ludlam +;; Author: Eric M. Ludlam ;; This file is part of GNU Emacs.