summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-22 06:56:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-22 06:56:11 -0700
commit423d823c227f8c8ffb41ef32c6909e77e1ccd8f3 (patch)
treefc92c80f9c9f5a39342b219e430f4d3f4bee80c0 /lib.c
parent65531dd765edadeb2fb2a83cf82df4af73100b95 (diff)
downloadtxr-423d823c227f8c8ffb41ef32c6909e77e1ccd8f3.tar.gz
txr-423d823c227f8c8ffb41ef32c6909e77e1ccd8f3.tar.bz2
txr-423d823c227f8c8ffb41ef32c6909e77e1ccd8f3.zip
printer: add package prefix on symbols with zero-length name.
* lib.c (symbol_needs_prefix): If the name is an empty string, the symbol needs a prefix. Otherwise it disappears in the output.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 9133f024..1ad10b78 100644
--- a/lib.c
+++ b/lib.c
@@ -5497,6 +5497,9 @@ val symbol_needs_prefix(val self, val package, val sym)
if (sym_pkg == keyword_package)
return null_string;
+ if (length_str(name) == zero)
+ return sym_pkg->pk.name;
+
if (sym_pkg == package) {
if (us_hash_count(package->pk.hidhash) != zero) {
val here_cell = gethash_e(self, package->pk.symhash, name);