summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/txr.c b/txr.c
index 66ee31ac..21e30f87 100644
--- a/txr.c
+++ b/txr.c
@@ -130,11 +130,15 @@ static val remove_hash_bang_line(val spec)
{
val shbang = string(L"#!");
val firstline = first(spec);
-
- if (stringp(first(firstline))) {
- val twochars = sub_str(first(firstline), zero, two);
- if (equal(twochars, shbang))
- return rest(spec);
+ val firstelem = first(firstline);
+
+ if (consp(firstelem) && first(firstelem) == text_s) {
+ val item = second(firstelem);
+ if (stringp(item)) {
+ val twochars = sub_str(item, zero, two);
+ if (equal(twochars, shbang))
+ return rest(spec);
+ }
}
return spec;