summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-01-21 20:21:45 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-01-21 20:29:42 -0800
commit8dd58a2d1fedaa16573bc67e986dc2014620c681 (patch)
tree14d570f1ebf867a8feb07cfe3d3a385989643e1f /src/fileio.c
parent938bca8e4141f5f96497f9be26b0ea0bb90f40cd (diff)
downloademacs-8dd58a2d1fedaa16573bc67e986dc2014620c681.tar.gz
emacs-8dd58a2d1fedaa16573bc67e986dc2014620c681.tar.bz2
emacs-8dd58a2d1fedaa16573bc67e986dc2014620c681.zip
Don't downcase system diagnostics' first letters
* etc/NEWS: Document this. * lisp/emacs-lisp/bytecomp.el (byte-compile-file): * lisp/ffap.el (find-file-at-point): * lisp/files.el (insert-file-1): * lisp/net/ange-ftp.el (ange-ftp-barf-if-not-directory) (ange-ftp-copy-file-internal): * lisp/progmodes/etags.el (visit-tags-table): * lisp/url/url-dav.el (url-dav-delete-directory, url-dav-delete-file) (url-dav-directory-files): Keep diagnostics consistent with system's. * lisp/erc/erc-dcc.el (erc-dcc-server): * lisp/ffap.el (ffap-machine-p): Ignore case while comparing diagnostics. * src/fileio.c (report_file_errno): Don't downcase, and simplify. Fixes: bug#19642
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/fileio.c b/src/fileio.c
index ff6720d4ae2..d0fd08a742e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -186,37 +186,17 @@ void
report_file_errno (char const *string, Lisp_Object name, int errorno)
{
Lisp_Object data = CONSP (name) || NILP (name) ? name : list1 (name);
- Lisp_Object errstring;
- char *str;
-
synchronize_system_messages_locale ();
- str = strerror (errorno);
- errstring = code_convert_string_norecord (build_unibyte_string (str),
- Vlocale_coding_system, 0);
-
- while (1)
- switch (errorno)
- {
- case EEXIST:
- xsignal (Qfile_already_exists, Fcons (errstring, data));
- break;
- default:
- /* System error messages are capitalized. Downcase the initial
- unless it is followed by a slash. (The slash case caters to
- error messages that begin with "I/O" or, in German, "E/A".) */
- if (STRING_MULTIBYTE (errstring)
- && ! EQ (Faref (errstring, make_number (1)), make_number ('/')))
- {
- int c;
-
- str = SSDATA (errstring);
- c = STRING_CHAR ((unsigned char *) str);
- Faset (errstring, make_number (0), make_number (downcase (c)));
- }
-
- xsignal (Qfile_error,
- Fcons (build_string (string), Fcons (errstring, data)));
- }
+ char *str = strerror (errorno);
+ Lisp_Object errstring
+ = code_convert_string_norecord (build_unibyte_string (str),
+ Vlocale_coding_system, 0);
+ Lisp_Object errdata = Fcons (errstring, data);
+
+ if (errorno == EEXIST)
+ xsignal (Qfile_already_exists, errdata);
+ else
+ xsignal (Qfile_error, Fcons (build_string (string), errdata));
}
/* Signal a file-access failure that set errno. STRING describes the