diff -ur coreutils-6.7/doc/coreutils.texi coreutils-6.7.new/doc/coreutils.texi
--- coreutils-6.7/doc/coreutils.texi	2006-10-27 16:30:48.000000000 +0200
+++ coreutils-6.7.new/doc/coreutils.texi	2007-01-07 00:18:22.000000000 +0100
@@ -3567,6 +3567,15 @@
 The choice of hash function is affected by the
 @option{--random-source} option.
 
+@item -v
+@itemx --version-sort
+@opindex -v
+@opindex --version-sort
+@cindex version number, sorting by
+Strings are compared as version numbers so that @samp{1.2.3} <
+@samp{1.2.12}.  Comparison is done with the @code{strverscmp} function
+@pxref{String/Array Comparison,,strverscmp, libc.info}.
+
 @end table
 
 Other options are:
diff -ur coreutils-6.7/src/sort.c coreutils-6.7.new/src/sort.c
--- coreutils-6.7/src/sort.c	2006-11-13 19:14:02.000000000 +0100
+++ coreutils-6.7.new/src/sort.c	2007-01-07 00:35:02.000000000 +0100
@@ -154,6 +154,7 @@
   bool general_numeric;		/* Flag for general, numeric comparison.
 				   Handle numbers in exponential notation. */
   bool month;			/* Flag for comparison by month name. */
+  bool version;			/* Flag for version string comparison */
   bool reverse;			/* Reverse the sense of comparison. */
   struct keyfield *next;	/* Next keyfield to try. */
 };
@@ -309,6 +310,7 @@
   -n, --numeric-sort          compare according to string numerical value\n\
   -R, --random-sort           sort by random hash of keys\n\
       --random-source=FILE    get random bytes from FILE (default /dev/urandom)\n\
+  -v, --version-sort          compare keys as version number according to strverscmp\n\
   -r, --reverse               reverse the result of comparisons\n\
 \n\
 "), stdout);
@@ -367,7 +369,7 @@
   RANDOM_SOURCE_OPTION = CHAR_MAX + 1
 };
 
-static char const short_options[] = "-bcdfgik:mMno:rRsS:t:T:uy:z";
+static char const short_options[] = "-bcdfgik:mMnvo:rRsS:t:T:uy:z";
 
 static struct option const long_options[] =
 {
@@ -383,6 +385,7 @@
   {"numeric-sort", no_argument, NULL, 'n'},
   {"random-sort", no_argument, NULL, 'R'},
   {"random-source", required_argument, NULL, RANDOM_SOURCE_OPTION},
+  {"version-sort", no_argument, NULL, 'v'},
   {"output", required_argument, NULL, 'o'},
   {"reverse", no_argument, NULL, 'r'},
   {"stable", no_argument, NULL, 's'},
@@ -1322,6 +1325,8 @@
 	}
       else if (key->month)
 	diff = getmonth (texta, lena) - getmonth (textb, lenb);
+      else if (key->version)
+	diff = strverscmp(texta, textb);
       /* Sorting like this may become slow, so in a simple locale the user
 	 can select a faster sort that is similar to ascii sort.  */
       else if (hard_LC_COLLATE)
@@ -2260,6 +2265,9 @@
 	case 'R':
 	  key->random = true;
 	  break;
+	case 'v':
+	  key->version = true;
+	  break;
 	case 'r':
 	  key->reverse = true;
 	  break;
@@ -2370,7 +2378,7 @@
   gkey.ignore = NULL;
   gkey.translate = NULL;
   gkey.numeric = gkey.general_numeric = gkey.random = false;
-  gkey.month = gkey.reverse = false;
+  gkey.month = gkey.version = gkey.reverse = false;
   gkey.skipsblanks = gkey.skipeblanks = false;
 
   files = xnmalloc (argc, sizeof *files);
@@ -2452,6 +2460,7 @@
 	case 'n':
 	case 'r':
 	case 'R':
+	case 'v':
 	  {
 	    char str[2];
 	    str[0] = c;
@@ -2615,7 +2624,7 @@
              || (key->skipsblanks | key->reverse
                  | key->skipeblanks | key->month | key->numeric
                  | key->general_numeric
-                 | key->random)))
+                 | key->random | key->version)))
         {
           key->ignore = gkey.ignore;
           key->translate = gkey.translate;
@@ -2625,6 +2634,7 @@
           key->numeric = gkey.numeric;
           key->general_numeric = gkey.general_numeric;
           key->random = gkey.random;
+          key->version = gkey.version;
           key->reverse = gkey.reverse;
         }
 
@@ -2634,7 +2644,7 @@
   if (!keylist && (gkey.ignore || gkey.translate
 		   || (gkey.skipsblanks | gkey.skipeblanks | gkey.month
 		       | gkey.numeric | gkey.general_numeric
-                       | gkey.random)))
+                       | gkey.random | gkey.version)))
     {
       insertkey (&gkey);
       need_random |= gkey.random;
