r3 - 15 Feb 2005 - 01:41:31 - SamHaslerYou are here: TWiki >  Codev Web > OsDetectionFailsOnMacOSX
Tags:
, create new tag

Bug: OsDetectionFailsOnMacOSX

The new release of TWiki has code in TWiki.cfg that attempts to determine the server's operating system. On MacOSX this is incorrectly determined to be "WINDOWS", which causes failures in (at least) the RCS interface.

Test case

Fix record

In TWiki.cfg, the OS-detection code attempts to get the value of $^O with the OS identifier. On MacOSX this properly returns "darwin". However, code following this incorrectly replaces that value with "WINDOWS" because of a spurious regexp match against the pattern /Win/i.

To correct the defect, change the clause around line 84 from:

if ($OS=~/Win/i) {
  $OS = 'WINDOWS';
} elsif ($OS=~/vms/i) {
to
if ($OS=~/darwin/i) {
  $OS = 'UNIX';
} elsif ($OS=~/Win/i) {
  $OS = 'WINDOWS';
} elsif ($OS=~/vms/i) {

Note that the test for "darwin" must precede the test for "Win".

Environment

TWiki version: 20010901
TWiki plugins: default
Server OS: MacOS X 10.0.4 (darwin)
Web server: Apache
Perl version: 5.6.0
Client OS: n/a
Web Browser: n/a

-- ToddJonker - 26 Sep 2001

Updated in CVS. The code came from CGI.pm, I guess my version had caught up with Darwin. Interesting that Darwin contains windows!

-- JohnTalintyre - 27 Sep 2001

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo