All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Bug] Duplication in Array Element not Handled in Parsing conf
       [not found] <1623301608142592907-webhooks-bot@alsa-project.org>
@ 2021-06-10  5:06 ` GitHub issues - opened
  0 siblings, 0 replies; only message in thread
From: GitHub issues - opened @ 2021-06-10  5:06 UTC (permalink / raw)
  To: alsa-devel

alsa-project/alsa-lib issue #151 was opened from aiChaoSONG:

When parsing array element in conf files, an auto-increase number is used as config id(`snd_config_t->id`), and array element as the config value(`snd_config_t->u.string/integer/integer64/real`), duplication is not handle in `parse_array_defs/parse_array_def/parse_value` functions.

Suppose we have a conf:
```
array [
    "a"
    "b"
    "a"
]
```
the parsed result will be:
```
    parent
        |
        ---- snd_config_t {id: "0", u.string: "a"}
        |
        ---- snd_config_t {id: "1", u.string: "b"}
        |
        ---- snd_config_t {id: "2", u.string: "a"}
```
The duplication in "a" may be desired. But please consider this condition: suppose we have four conf files A, B, C and D, where A 
is the conf above, let B include A, C include A, D include B and C, so D include A twice indirectly. File A will be processed twice when parsing D, because duplication is not handled, here comes the problem, the parsed result of A in D is:
```
    parent
        |
        ---- snd_config_t {id: "0", u.string: "a"}
        |
        ---- snd_config_t {id: "1", u.string: "b"}
        |
        ---- snd_config_t {id: "2", u.string: "a"}
        |
        ---- snd_config_t {id: "3", u.string: "a"}
        |
        ---- snd_config_t {id: "4", u.string: "b"}
        |
        ---- snd_config_t {id: "5", u.string: "a"}
```
This is obviously wrong.

I think handle duplication in parse_value is not the solution, because element duplication in an array is wanted. The key problem here is that we parse the same conf more than once.

Issue URL     : https://github.com/alsa-project/alsa-lib/issues/151
Repository URL: https://github.com/alsa-project/alsa-lib

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-10  5:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1623301608142592907-webhooks-bot@alsa-project.org>
2021-06-10  5:06 ` [Bug] Duplication in Array Element not Handled in Parsing conf GitHub issues - opened

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.