1
0
forked from aniani/vim

Various small fixes from Dominique Pelle.

This commit is contained in:
Bram Moolenaar
2010-06-26 06:24:45 +02:00
parent 0eda7ac7f8
commit 644044794e
18 changed files with 1423 additions and 1100 deletions

View File

@@ -168,7 +168,7 @@ name_part(char *font, char *buf)
get_part(font, 2, buf2);
get_part(font, 1, buf3);
if (strlen(buf3))
if (*buf3 != NUL)
vim_snprintf(buf, TEMP_BUF_SIZE, "%s (%s)", buf2, buf3);
else
vim_snprintf(buf, TEMP_BUF_SIZE, "%s", buf2);
@@ -225,7 +225,7 @@ size_part(char *font, char *buf, int inPixels)
if (inPixels)
{
get_part(font, 7, buf);
if (strlen(buf) > 0)
if (*buf != NUL)
{
size = atoi(buf);
sprintf(buf, "%3d", size);
@@ -234,7 +234,7 @@ size_part(char *font, char *buf, int inPixels)
else
{
get_part(font, 8, buf);
if (strlen(buf) > 0)
if (*buf != NUL)
{
size = atoi(buf);
temp = (float)size / 10.0;
@@ -261,7 +261,7 @@ encoding_part(char *font, char *buf)
get_part(font, 13, buf1);
get_part(font, 14, buf2);
if (strlen(buf1) > 0 && strlen(buf2))
if (*buf1 != NUL && *buf2 != NUL)
vim_snprintf(buf, TEMP_BUF_SIZE, "%s-%s", buf1, buf2);
if (!strcmp(buf, " "))
strcpy(buf, "-");
@@ -1229,10 +1229,10 @@ gui_xm_select_font(char_u *current)
size_part(found, sizebuf, data->in_pixels);
encoding_part(found, encodingbuf);
if (strlen(namebuf) > 0
&& strlen(stylebuf) > 0
&& strlen(sizebuf) > 0
&& strlen(encodingbuf) > 0)
if (*namebuf != NUL
&& *stylebuf != NUL
&& *sizebuf != NUL
&& *encodingbuf != NUL)
{
data->sel[NAME] = XtNewString(namebuf);
data->sel[STYLE] = XtNewString(stylebuf);