Closed
Bug 122510
Opened 23 years ago
Closed 21 years ago
Deprecate PR_GetDirectorySeparator()
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
VERIFIED
WONTFIX
People
(Reporter: john, Assigned: wtc)
Details
The directory separator for Macintosh is a ':'. Yet when we define it in
http://lxr.mozilla.org/seamonkey/source/nsprpub/pr/include/md/_macos.h, we
define it as '/'. Form submission currently works around this with an ifdef (it
uses ':' on Mac and PR_DIRECTORY_SEP on other platforms).
Mac I/O code works because it does path translation from ':' to '/', but when it
does this it uses PR_PATH_SEP for the ':' when that's not what it's being used for!
Assignee | ||
Comment 1•23 years ago
|
||
This is a valid proposal, but we can't make this
incompatible change. Sorry.
I suggest that you define your own directory separator
macros that expand to the right characters.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
is it well documented that these two consts pairs are totally broken? if not
please document it.
Could nspr create an opt in (#ifdef NSPR_CORRECTMAC_SEP) to get the correct
values for these constants? then seamonkey can do the right thing by opting in
and others can be given a warning that their code is broken with an explanation
of how to fix it.
Assignee | ||
Comment 3•23 years ago
|
||
NSPR is not exporting the PR_DIRECTORY_SEPARATOR macro.
I suspect that the form submitter code is getting the
definition of PR_DIRECTORY_SEPARATOR from xp_path.h.
I added the PR_DIRECTORY_SEPARATOR macro definition
to xp_path.h when I found that Mozilla Classic was
including NSPR's private header files to get the
definition of PR_DIRECTORY_SEPARATOR, and that macro
and other similar macros were used in many Mozilla
Classic files. In hindsight it was the wrong thing
to do but it seemed like an expedient solution at
that time.
I just did an LXR search for PR_DIRECTORY_SEPARATOR
in the current Mozilla and found that there are only
three files using this macro (one in OJI, two in
form submitter). So I suggest that you do this:
1. Remove the PR_DIRECTORY_* and PR_PATH_* macros
from xp_path.h.
2. Define your own directory and path separator
macros.
3. Modify the OJI and form submittor files to use
the new macros.
timeless wrote:
> is it well documented that these two consts pairs
> are totally broken? if not please document it.
As I explained above, NSPR does not export these
macros. However, it does export the
PR_GetDirectorySeparator() function, which also
returns '/' on Mac. I found that this function is
not documented. Since it returns inconsistent
results (on Windows, it returns the native directory
separator \, on Mac, it returns the NSPR directory
separator /), perhaps this function should be
deprecated and stay undocumented.
Deprecating PR_GetDirectorySeparator() sounds fine with me. Do you want to
provide a replacement or should xpcom define its own (nsIFile could probably do
that)?
Summary: Macintosh PR_DIRECTORY_SEP incorrect → Macintosh PR_DIRECTORY_SEP and PR_GetDirectorySeparator() are incorrect
Comment 5•23 years ago
|
||
I would rather see these on a system info interface.
.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Summary: Macintosh PR_DIRECTORY_SEP and PR_GetDirectorySeparator() are incorrect → Deprecate PR_GetDirectorySeparator()
please deprecate this for the next release
Assignee: timeless → wtc
Status: REOPENED → NEW
Reporter | ||
Comment 9•23 years ago
|
||
Form submission is no longer using directory separator foo, BTW (it's parsing
using the standard file parser).
Comment 10•22 years ago
|
||
Whatever replaces PR_GetDirectorySeparator should replace PR_GetPathSeparator as
well.
Assignee | ||
Comment 11•22 years ago
|
||
cls, I don't understand your comment. PR_GetPathSeparator does
not have the problem of PR_GetDirectorySeparator that I described
in the last paragraph of comment 3.
Comment 12•22 years ago
|
||
I was mainly just making a note about the new function so that the functionality
isn't overlooked. IMO, the two functions go hand-in-hand. If you can get the
directory separator from nsISystemInfo (or somewhere else outside of NSPR), you
should be able to get the path separator from there as well.
Btw, is there a bug on adding that functionality to nsISystemInfo or are we
overloading this one?
Comment 13•21 years ago
|
||
Is this still needed on other platforms or can this be resolved because we
removed mac classic from the cvs tree?
Assignee | ||
Comment 14•21 years ago
|
||
Right. Now that we don't support Mac Classic, we
no longer need to deprecate PR_GetDirectorySeparator().
Status: NEW → RESOLVED
Closed: 23 years ago → 21 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•