summaryrefslogtreecommitdiff
path: root/gl/lib/mbsalign.h
AgeCommit message (Collapse)Author
2017-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2016-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2015-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * tests/sample-test: Adjust to use the single most recent year. * tests/du/bind-mount-dir-cycle-v2.sh: Fix case in copyright message, so that year is updated automatically in future.
2014-01-02maint: update all copyright year number rangesBernhard Voelker
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2013-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2012-09-12maint: mbsalign.h: fix typo from previous comment editBernhard Voelker
* gl/lib/mbsalign.h: Fix comment typo.
2012-09-11maint: add more control flags to mbsalignPádraig Brady
* gl/lib/mbsalign.h: Add MBA_UNIBYTE_ONLY (to allow faster processing). Also add MBA_NO_LEFT_PAD, MBA_NO_RIGHT_PAD to give greater control of padding, useful with the first or last fields on a line. * gl/lib/mbsalign.c (mbsalign): Implement the new flags. * gl/tests/test-mbsalign.c (main): Test combinations of the new flags.
2012-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2011-04-11maint: remove doubled words in comments, e.g., s/to to/to/Jim Meyering
* tests/ls/color-norm: s/to to/to/ * gl/lib/mbsalign.h (mbs_align_t): s/or or/or/ * src/extent-scan.c (extent_scan_read): s/the the/the/ * src/libstdbuf.c: s/the the/the/ * tests/misc/stdbuf: s/on on/on/ * ChangeLog-2005: s/for\n\tfor /for\n\t/
2011-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2010-10-01maint: ensure the mbsalign module is C89 compatiblePádraig Brady
This module may be moved to gnulib at some stage, so keep it C89 compatible. * gl/lib/mbsalign.c (mbsalign): Declare variables at start of scope (ambsalign): Likewise * gl/lib/mbsalign.h: Remove trailing comma from enum Reported by Andrei Suhan
2010-03-19maint: update the mbsalign modulePádraig Brady
* gl/lib/mbsalign.c (mbsalign): Support the MBA_UNIBYTE_FALLBACK flag which reverts to unibyte mode if one can't allocate memory or if there are invalid multibyte characters present. Note memory is no longer dynamically allocated in unibyte mode so one can assume that mbsalign() will not return an error if this flag is present. Don't calculate twice, the number of spaces, when centering. Suppress a signed/unsigned comparison warning. (ambsalign): A new wrapper function to dynamically allocate the minimum memory required to hold the aligned string. * gl/lib/mbsalign.h: Add the MBA_UNIBYTE_FALLBACK flag and also document others that may be implemented in future. (ambsalign): A prototype for the new wrapper. * gl/tests/test-mbsalign.c (main): New test program. * gl/modules/mbsalign-tests: A new index to reference the tests. * .x-sc_program_name: Exclude test-mbsalign.c from this check.
2010-01-01maint: update all FSF copyright year lists to include 2010Jim Meyering
Use this command: git ls-files | grep -v COPYING \ | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \ build-aux/update-copyright
2009-04-03ls: fix alignment when month names have varying widthsPádraig Brady
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR locale has recently changed to use the official but variable width abbreviated month names. Other glibc locales also have variable widths. http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html http://sourceware.org/bugzilla/show_bug.cgi?id=9859 * NEWS: Mention the fix * gl/lib/mbsalign.c: A new module to align and truncate a string in a specified number of screen cells, while handling multi-byte characters appropriately. * gl/lib/mbsalign.h: Ditto * gl/modules/mbsalign: Ditto * bootstrap.conf: Reference the new module * src/ls.c (abmon_init): New function, precompute the abbreviated months aligned left in a minimum width column <= 5 screen cells. (align_nstrftime): New function, replace the first %b in the format specification to strftime with the precomputed month string. Note using the cached month strings speeds up `ls -lU` by around 17% on glibc-2.7-2 on linux at least. Also if we implement this function using heap storage rather than automatic storage, and use snprintf instead of strcpy, ls will slow down by 2% and 1% respectively (i.e. a net gain of 14% rather than 17%). * tests/ls/abmon-align: A new test to test ls alignment for various formats and locales * tests/Makefile.am: Reference the new test