Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
33fda932
Commit
33fda932
authored
Jul 25, 2017
by
Hisham Muhammad
Committed by
GitHub
Jul 25, 2017
Browse files
Merge pull request #657 from kalbasit/remove_whitespace_from_config_file
Settings: do not emit trailing whitespace
parents
e940aecf
ce0cf3c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Settings.c
View file @
33fda932
...
...
@@ -255,23 +255,29 @@ static bool Settings_read(Settings* this, const char* fileName) {
static
void
writeFields
(
FILE
*
fd
,
ProcessField
*
fields
,
const
char
*
name
)
{
fprintf
(
fd
,
"%s="
,
name
);
const
char
*
sep
=
""
;
for
(
int
i
=
0
;
fields
[
i
];
i
++
)
{
// This "-1" is for compatibility with the older enum format.
fprintf
(
fd
,
"%d "
,
(
int
)
fields
[
i
]
-
1
);
fprintf
(
fd
,
"%s%d"
,
sep
,
(
int
)
fields
[
i
]
-
1
);
sep
=
" "
;
}
fprintf
(
fd
,
"
\n
"
);
}
static
void
writeMeters
(
Settings
*
this
,
FILE
*
fd
,
int
column
)
{
const
char
*
sep
=
""
;
for
(
int
i
=
0
;
i
<
this
->
columns
[
column
].
len
;
i
++
)
{
fprintf
(
fd
,
"%s "
,
this
->
columns
[
column
].
names
[
i
]);
fprintf
(
fd
,
"%s%s"
,
sep
,
this
->
columns
[
column
].
names
[
i
]);
sep
=
" "
;
}
fprintf
(
fd
,
"
\n
"
);
}
static
void
writeMeterModes
(
Settings
*
this
,
FILE
*
fd
,
int
column
)
{
const
char
*
sep
=
""
;
for
(
int
i
=
0
;
i
<
this
->
columns
[
column
].
len
;
i
++
)
{
fprintf
(
fd
,
"%d "
,
this
->
columns
[
column
].
modes
[
i
]);
fprintf
(
fd
,
"%s%d"
,
sep
,
this
->
columns
[
column
].
modes
[
i
]);
sep
=
" "
;
}
fprintf
(
fd
,
"
\n
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment