Commit 553c98dc authored by Russ Cox's avatar Russ Cox

fix renamed-package bug in exported names:

always show original name

R=ken
OCL=18603
CL=18603
parent 11a3f759
...@@ -912,14 +912,13 @@ out: ...@@ -912,14 +912,13 @@ out:
int int
Sconv(Fmt *fp) Sconv(Fmt *fp)
{ {
char buf[500];
Sym *s; Sym *s;
char *opk, *pkg, *nam; char *opk, *pkg, *nam;
s = va_arg(fp->args, Sym*); s = va_arg(fp->args, Sym*);
if(s == S) { if(s == S) {
snprint(buf, sizeof(buf), "<S>"); fmtstrcpy(fp, "<S>");
goto out; return 0;
} }
pkg = "<nil>"; pkg = "<nil>";
...@@ -934,18 +933,12 @@ Sconv(Fmt *fp) ...@@ -934,18 +933,12 @@ Sconv(Fmt *fp)
nam = s->name; nam = s->name;
if(!(fp->flags & FmtShort)) if(!(fp->flags & FmtShort))
if(strcmp(pkg, package) || strcmp(opk, package) || (fp->flags & FmtLong)) { if(strcmp(opk, package) || (fp->flags & FmtLong)) {
if(strcmp(opk, pkg) == 0) { fmtprint(fp, "%s.%s", opk, nam);
snprint(buf, sizeof(buf), "%s.%s", pkg, nam); return 0;
goto out;
}
snprint(buf, sizeof(buf), "(%s)%s.%s", opk, pkg, nam);
goto out;
} }
snprint(buf, sizeof(buf), "%s", nam); fmtstrcpy(fp, nam);
return 0;
out:
return fmtstrcpy(fp, buf);
} }
static char* static char*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment