diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-28 21:47:18 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-28 21:47:18 +0000 |
commit | 2b92dfceaa9d709661beb0761c3c790732df0cbc (patch) | |
tree | 209c29455bbe5f778f77447c6260b44a61f08855 /op.c | |
parent | 056534bf6b6b1b89850de37d21bf18c33cca9bd7 (diff) | |
download | perl-2b92dfceaa9d709661beb0761c3c790732df0cbc.tar.gz |
todo item: permit extended control variables a la ${^Foo} (patch
courtesy Mark-Jason Dominus <mjd@plover.com>)
p4raw-id: //depot/perl@3039
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -129,7 +129,21 @@ pad_allocmy(char *name) name[1] == '_' && (int)strlen(name) > 2)) { if (!isPRINT(name[1])) { - name[3] = '\0'; + /* 1999-02-27 mjd@plover.com */ + char *p; + p = strchr(name, '\0'); + /* The next block assumes the buffer is at least 205 chars + long. At present, it's always at least 256 chars. */ + if (p-name > 200) { + strcpy(name+200, "..."); + p = name+199; + } + else { + p[1] = '\0'; + } + /* Move everything else down one character */ + for (; p-name > 2; p--) + *p = *(p-1); name[2] = toCTRL(name[1]); name[1] = '^'; } |