Changeset fcfac250 in mainline


Ignore:
Timestamp:
2011-08-21T08:15:13Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
19d007e
Parents:
e406736
Message:

Use proper formula to calculate number of spaces between words when using ALIGN_JUSITFY

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/help/help.c

    re406736 rfcfac250  
    153153            "To learn more please point your browser to the HelenOS User's "
    154154            "Guide: http://trac.helenos.org/trac.fcgi/wiki/UsersGuide\n\n",
    155              ALIGN_LEFT);
     155             ALIGN_JUSTIFY);
    156156}
    157157
  • uspace/lib/fmtutil/fmtutil.c

    re406736 rfcfac250  
    145145                        if (i == len) break;
    146146                        if (done_words) {
    147                                 // TODO: use better formula
    148                                 size_t spaces = 1 + (excess_spaces /
    149                                     (words - 1));
     147                                size_t spaces = 1 + (((done_words *
     148                                    excess_spaces) / (words - 1)) -
     149                                    (((done_words - 1) * excess_spaces) /
     150                                    (words - 1)));
    150151                                for (j = 0; j < spaces; j++) {
    151152                                        putchar(' ');
Note: See TracChangeset for help on using the changeset viewer.