danf: curl-www/dlwiz index.cgi,1.14,1.15

[email protected]
Newsgroups gmane.comp.web.curl.www.cvs
Message-ID <[email protected]>
Update of /cvsroot/curl/curl-www/dlwiz
In directory labb:/tmp/cvs-serv9802

Modified Files:
	index.cgi 
Log Message:
Added Ubuntu version detection.
Added PalmOS detection (so it won't be misidentified as Windows).


Index: index.cgi
===================================================================
RCS file: /cvsroot/curl/curl-www/dlwiz/index.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- index.cgi	13 Apr 2006 17:31:55 -0000	1.14
+++ index.cgi	29 Jun 2006 00:44:23 -0000	1.15
@@ -251,13 +251,7 @@
 
 if($pick_type && !$pick_os) {
 
-    if($ua =~ /Windows 3\.|Win16/i) {
-        $sel_os = "DOS";
-    }
-    elsif($ua =~ /(windows|win32|Win98|Win95|Win9x|WinNT)/i) {
-        $sel_os = "Win32";
-    }
-    elsif($ua =~ /Linux/i) {
+    if($ua =~ /Linux/i) {
         $sel_os = "Linux";
     }
     elsif($ua =~ /IRIX/i) {
@@ -317,9 +311,20 @@
     elsif($ua =~ /OS\/2/i) {
         $sel_os = "OS/2";
     }
+    elsif($ua =~ /Palm/i) {
+        $sel_os = "Palm OS";
+    }
     elsif($ua =~ /Indy Library/i) {     # Windows-only client library
         $sel_os = "Win32";
     }
+    elsif($ua =~ /Windows 3\.|Win16/i) {
+        $sel_os = "DOS";
+    }
+    # Windows goes near the end because some other platforms also say Windows
+    # for compatibility reasons
+    elsif($ua =~ /(windows|win32|Win98|Win95|Win9x|WinNT)/i) {
+        $sel_os = "Win32";
+    }
     elsif($ua =~ /(Lynx|w3m|Dillo|MMM|Grail|Mosaic|amaya|Konqueror|Links|gzilla)/i) {
         $sel_os = "Linux"; # we don't know these are Linux, we just guess
     }
@@ -528,6 +533,9 @@
         elsif($pick_flav eq "Redhat" && $ua =~ /\bEL([\d\.]+)/i) {
             $sel_ver = "RHEL" . $1;
         }
+        elsif($pick_flav eq "Ubuntu" && $ua =~ /\bUbuntu\/([\w\.]+)/i) {
+            $sel_ver = $1;
+        }
         elsif($pick_os eq "Win32" && $ua =~ /Windows NT ?5\b|Windows XP/i) {
             $sel_ver = "2000/XP";
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.