openwrt / openwrt/libubox

Remove leading space from key(s)

Open Beginner friendly
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
32
Forks
35
PR merge metrics
No merged PRs in 30d

Description

Leading space in string of elements key(s) returned from json_get_keys() should be suppressed / removed.

Parsing the returned string with shell parameter expansion(s) results in incorrect value(s) -

# json_get_keys _s
# $_s = ' key0 key1 key2'
echo ${_s#* } # ' key0 key1 key2'
echo ${_s# * } # 'key1 key2'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the libubox sources for the json_get_keys() implementation and inspect how its returned key string is assembled. Confirm that the first key has no leading space, then verify the shell parameter-expansion example no longer produces the incorrect value.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.