~ted/ubuntu/karmic/vim/add-breaks

« back to all changes in this revision

Viewing changes to src/message.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-01-13 18:39:18 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090113183918-kgq1jzdwsbbex4pq
Tags: 2:7.2.079-1ubuntu1
* Resynchronise with Debian (diversions fix closes LP: #296324). Remaining
  changes:
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/debchangelog.vim:
    + Add "jaunty" to the list of valid suites.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4585
4585
                        if (remove_trailing_zeroes)
4586
4586
                        {
4587
4587
                            int i;
4588
 
                            char *p;
 
4588
                            char *tp;
4589
4589
 
4590
4590
                            /* Using %g or %G: remove superfluous zeroes. */
4591
4591
                            if (fmt_spec == 'f')
4592
 
                                p = tmp + str_arg_l - 1;
 
4592
                                tp = tmp + str_arg_l - 1;
4593
4593
                            else
4594
4594
                            {
4595
 
                                p = (char *)vim_strchr((char_u *)tmp,
 
4595
                                tp = (char *)vim_strchr((char_u *)tmp,
4596
4596
                                                 fmt_spec == 'e' ? 'e' : 'E');
4597
 
                                if (p != NULL)
 
4597
                                if (tp != NULL)
4598
4598
                                {
4599
4599
                                    /* Remove superfluous '+' and leading
4600
4600
                                     * zeroes from the exponent. */
4601
 
                                    if (p[1] == '+')
 
4601
                                    if (tp[1] == '+')
4602
4602
                                    {
4603
4603
                                        /* Change "1.0e+07" to "1.0e07" */
4604
 
                                        STRMOVE(p + 1, p + 2);
 
4604
                                        STRMOVE(tp + 1, tp + 2);
4605
4605
                                        --str_arg_l;
4606
4606
                                    }
4607
 
                                    i = (p[1] == '-') ? 2 : 1;
4608
 
                                    while (p[i] == '0')
 
4607
                                    i = (tp[1] == '-') ? 2 : 1;
 
4608
                                    while (tp[i] == '0')
4609
4609
                                    {
4610
4610
                                        /* Change "1.0e07" to "1.0e7" */
4611
 
                                        STRMOVE(p + i, p + i + 1);
 
4611
                                        STRMOVE(tp + i, tp + i + 1);
4612
4612
                                        --str_arg_l;
4613
4613
                                    }
4614
 
                                    --p;
 
4614
                                    --tp;
4615
4615
                                }
4616
4616
                            }
4617
4617
 
4618
 
                            if (p != NULL && !precision_specified)
 
4618
                            if (tp != NULL && !precision_specified)
4619
4619
                                /* Remove trailing zeroes, but keep the one
4620
4620
                                 * just after a dot. */
4621
 
                                while (p > tmp + 2 && *p == '0' && p[-1] != '.')
 
4621
                                while (tp > tmp + 2 && *tp == '0'
 
4622
                                                             && tp[-1] != '.')
4622
4623
                                {
4623
 
                                    STRMOVE(p, p + 1);
4624
 
                                    --p;
 
4624
                                    STRMOVE(tp, tp + 1);
 
4625
                                    --tp;
4625
4626
                                    --str_arg_l;
4626
4627
                                }
4627
4628
                        }
4628
4629
                        else
4629
4630
                        {
4630
 
                            char *p;
 
4631
                            char *tp;
4631
4632
 
4632
4633
                            /* Be consistent: some printf("%e") use 1.0e+12
4633
4634
                             * and some 1.0e+012.  Remove one zero in the last
4634
4635
                             * case. */
4635
 
                            p = (char *)vim_strchr((char_u *)tmp,
 
4636
                            tp = (char *)vim_strchr((char_u *)tmp,
4636
4637
                                                 fmt_spec == 'e' ? 'e' : 'E');
4637
 
                            if (p != NULL && (p[1] == '+' || p[1] == '-')
4638
 
                                          && p[2] == '0'
4639
 
                                          && vim_isdigit(p[3])
4640
 
                                          && vim_isdigit(p[4]))
 
4638
                            if (tp != NULL && (tp[1] == '+' || tp[1] == '-')
 
4639
                                          && tp[2] == '0'
 
4640
                                          && vim_isdigit(tp[3])
 
4641
                                          && vim_isdigit(tp[4]))
4641
4642
                            {
4642
 
                                STRMOVE(p + 2, p + 3);
 
4643
                                STRMOVE(tp + 2, tp + 3);
4643
4644
                                --str_arg_l;
4644
4645
                            }
4645
4646
                        }