This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
perl 5.0 alpha 2
[perl5.git]
/
do
/
sreverse
1
int
2
do_sreverse(TARG,arglast)
3
STR *TARG;
4
int *arglast;
5
{
6
STR **st = stack->ary_array;
7
register char *up;
8
register char *down;
9
register int tmp;
10
11
str_sset(TARG,st[arglast[2]]);
12
up = str_get(TARG);
13
if (TARG->str_cur > 1) {
14
down = TARG->str_ptr + TARG->str_cur - 1;
15
while (down > up) {
16
tmp = *up;
17
*up++ = *down;
18
*down-- = tmp;
19
}
20
}
21
STABSET(TARG);
22
st[arglast[0]+1] = TARG;
23
return arglast[0]+1;
24
}
25