deleteBranch() dot madness

RESOLVED INACTIVE

Status

()

Core
Preferences: Backend
P5
normal
RESOLVED INACTIVE
5 years ago
18 hours ago

People

(Reporter: Ian Nartowicz, Unassigned)

Tracking

({helpwanted})

17 Branch
x86
Linux
helpwanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [bugday-20131002][lang=c++])

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20100101 Firefox/17.0
Build ID: 20130107124423

Steps to reproduce:

The nsiPrefBranch method deleteBranch() does weird things when a trailing dot is involved.


Actual results:

deleteBranch("myBranch") works fine and deletes "myBranch" and well as "myBranch.leaf".
deleteBranch("myBranch.") (single trailing dot) deletes "myBranch.leaf", but also deletes "myBranch" even though it has no trailing dot.
deleteBranch("myBranch..") (two trailing dots) doesn't delete "myBranch" but does delete "myBranch.leaf" even though it does not contain two dots.


Expected results:

I would have thought that the parameter to deleteBranch() should be treated as an exact initial string match to the preferences, not modified by adding or removing dots.  Just possibly if dots are to be treated as a syntax rather than just part of the string, then all trailing dots should be stripped.

There are comments in the code implying that this behaviour is related to an attempt to be compatible with the old nsIPref interface.  Dots are, sometimes, added in deleteBranch(), and then presumably removed somewhere deeper in the code.

Updated

5 years ago
Component: Untriaged → Preferences: Backend
Product: Firefox → Core
Whiteboard: [bugday-20131002]

Comment 1

5 years ago
I'm going to mark this NEW because there's definitely some weird fiddling going on. I think that the correct behavior should be:

deleteBranch("myBranch") should remove "myBranch" and "myBranch.child" but not "myBranch2" or "myBranch2.child"

deleteBranch("myBranch.") should delete "myBranch.child" but not "myBranch"

deleteBranch("myBranch..") should probably throw an invalid-argument exception.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: helpwanted
Priority: -- → P5
Whiteboard: [bugday-20131002] → [bugday-20131002][lang=c++]

Comment 2

18 hours ago
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 18 hours ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.