nsString Cut() method bug

RESOLVED FIXED in M7

Status

Core Graveyard
Tracking
P1
critical
RESOLVED FIXED
19 years ago
2 years ago

People

(Reporter: Robert John Churchill, Assigned: rickg)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
Rick, after your nsString/nsString2 landing, we're noticed a bug that I'm hoping
you can fix quickly.  Basically, the following code fails:

nsAutoString	attribValue;
if (attribValue.Find("rdf:") == 0)
{
    attribValue = attribValue.Cut(0,4);
}

The Cut() method seems to be returning crap in "attribValue".  It was working
fine on Friday afternoon though before your landing.
(Reporter)

Updated

19 years ago
Priority: P3 → P1

Updated

19 years ago
QA Contact: leger → rjc

Comment 1

19 years ago
Rick, removing the assignment ended up fixing the problem, so...I think you're
right about it being an edge case with self-assignment.
(Assignee)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 2

19 years ago
This was not a cut problem, but a user error. However, it usefully illustrated
that I needed to add logic to the assign and operator= to prevent assigning a
string to itself.

Updated

19 years ago
Target Milestone: M7
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.