[Git][cmucl/cmucl][issue-365-add-strerror] 2 commits: Update cmucl.pot file

Raymond Toy pushed to branch issue-365-add-strerror at cmucl / cmucl Commits: 8c703d45 by Raymond Toy at 2025-02-15T07:34:51-08:00 Update cmucl.pot file - - - - - 3e9e71b0 by Raymond Toy at 2025-02-15T07:35:00-08:00 Apply external format to string returned by strerror `strerror` returns a string of octets. We need to convert that set of octets to a Lisp string using the appropriate external format. I tested this using: ``` LANG=de_DE.utf-8 dist-linux/bin/lisp -quiet * (unix:get-unix-error-msg 14) "Ungültige Adresse" ``` Google translate says that's "Invalid address". Makes sense EFAULT, "Bad address". - - - - - 2 changed files: - src/code/unix.lisp - src/i18n/locale/cmucl.pot Changes: ===================================== src/code/unix.lisp ===================================== @@ -2628,9 +2628,20 @@ (defun unix-strerror (errno) _N"Returns a string that describes the error code Errno" - (cast - (alien-funcall - (extern-alien "strerror" - (function (* char) int)) - errno) - c-string)) + (let ((result + (alien-funcall + (extern-alien "strerror" + (function (* unsigned-char) int)) + errno))) + ;; We need to convert the set of octets to a Lisp string according + ;; to the appropriate external format. Copy the C string out to + ;; an array which we can then convert to a string. + (let* ((octets (make-array 100 :element-type '(unsigned-byte 8) :fill-pointer 0))) + (loop for k from 0 + for byte = (deref result k) + until (zerop byte) + do + (vector-push-extend byte octets)) + (lisp::with-array-data ((data octets) (start) (end)) + (declare (ignore start end)) + (values (stream:octets-to-string data :end (length octets))))))) ===================================== src/i18n/locale/cmucl.pot ===================================== @@ -6209,7 +6209,7 @@ msgid "Same as -help." msgstr "" #: src/code/commandline.lisp -msgid "Prints the cmucl version and exits" +msgid "Prints the cmucl version and exits, without loading the lisp core." msgstr "" #: src/code/commandline.lisp View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/bc2051dbaf71a369a3b3b17... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/bc2051dbaf71a369a3b3b17... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)