summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-07-24 19:31:11 +0000
committerBram Moolenaar <Bram@vim.org>2008-07-24 19:31:11 +0000
commit1387a60919113bd37e7d666b7f0e5f7eb3aa26a4 (patch)
tree7c77a668be17428ccd3a7f4f738f322a429a7555 /src/ex_cmds.c
parente6a91fd99467f5259d675047760088efcbaf050e (diff)
updated for version 7.2b-020v7.2b.020
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 0f8af05151..d700cc5373 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -479,10 +479,13 @@ ex_sort(eap)
c = *s2;
(*s2) = 0;
/* Sorting on number: Store the number itself. */
+ p = s + start_col;
if (sort_hex)
- s = skiptohex(s + start_col);
+ s = skiptohex(p);
else
- s = skiptodigit(s + start_col);
+ s = skiptodigit(p);
+ if (s > p && s[-1] == '-')
+ --s; /* include preceding negative sign */
vim_str2nr(s, NULL, NULL, sort_oct, sort_hex,
&nrs[lnum - eap->line1].start_col_nr, NULL);
(*s2) = c;