]> sourceware.org Git - lvm2.git/commit
config: remove unnecessary copy of config line's space prefix before printing
authorPeter Rajnoha <prajnoha@redhat.com>
Wed, 17 Aug 2022 08:11:05 +0000 (10:11 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Wed, 17 Aug 2022 08:47:43 +0000 (10:47 +0200)
commit8a23683a59835d967eff193bf1f82cc4ee5a6fdf
tree3526ea3242d7af7e7eeae0803b1e8c95600ce3c5
parentb4cc28c2ef72ee022c1a03819927e31775c18676
config: remove unnecessary copy of config line's space prefix before printing

When we wanted to insert '#' before a config line (to comment it out),
we used dm_pool_strndup to temporarily copy the space prefix first so
we can assemble the final line with:

   "<space_prefix># <key>=<value>":

out of original:

  "<space_prefix><key>=<value>".

The space_prefix copy is not necessary, we can just use fprintf's
precision modifier "%.*s" to print the exact part if we alrady
know space_prefix length.
lib/config/config.c
This page took 0.032829 seconds and 5 git commands to generate.