Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
fixup #674 - should test .length instead of .ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Dec 16, 2013
1 parent 663260c commit 6e2570e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/core/exception.d
Expand Up @@ -221,7 +221,7 @@ class OutOfMemoryError : Error

@trusted override const string toString()
{
return msg.ptr ? (cast()super).toString() : "Memory allocation failed";
return msg.length ? (cast()super).toString() : "Memory allocation failed";
}
}

Expand Down Expand Up @@ -262,7 +262,7 @@ class InvalidMemoryOperationError : Error

@trusted override const string toString()
{
return msg.ptr ? (cast()super).toString() : "Invalid memory operation";
return msg.length ? (cast()super).toString() : "Invalid memory operation";
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/object_.d
Expand Up @@ -1365,13 +1365,13 @@ class Throwable : Object
SizeStringBuff tmpBuff = void;

sink(typeid(this).name);
if (file.ptr)
if (file.length)
{
sink("@"); sink(file);
sink("("); sink(line.sizeToTempString(tmpBuff)); sink(")");
}

if (msg.ptr)
if (msg.length)
{
sink(": "), sink(msg);
}
Expand Down
4 changes: 2 additions & 2 deletions src/rt/cover.d
Expand Up @@ -241,7 +241,7 @@ string appendFN( string path, string name )

auto dest = path;

if( dest.ptr && dest[$ - 1] != sep )
if( dest.length && dest[$ - 1] != sep )
dest ~= sep;
dest ~= name;
return dest;
Expand All @@ -264,7 +264,7 @@ string baseName( string name, string ext = null )
ret ~= c;
}
}
return chomp( ret, ext.ptr ? ext : "" );
return ext.length ? chomp(ret, ext) : ret;
}


Expand Down
2 changes: 1 addition & 1 deletion src/rt/trace.d
Expand Up @@ -675,7 +675,7 @@ static void trace_merge()
SymPair *sfanin;
SymPair **psp;

if (trace_logfilename.ptr && (fp = fopen(trace_logfilename.ptr,"r")) !is null)
if (trace_logfilename.length && (fp = fopen(trace_logfilename.ptr,"r")) !is null)
{
buf = null;
sfanin = null;
Expand Down

0 comments on commit 6e2570e

Please sign in to comment.