Index: /main/trunk/greenstone2/perllib/mgbuilder.pm
===================================================================
--- /main/trunk/greenstone2/perllib/mgbuilder.pm	(revision 28374)
+++ /main/trunk/greenstone2/perllib/mgbuilder.pm	(revision 28375)
@@ -139,5 +139,5 @@
 
     my $osextra = "";
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	$fulltextprefix =~ s@/@\\@g;
     } else {
@@ -354,5 +354,5 @@
 
     my $osextra = "";
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	$fullindexprefix =~ s@/@\\@g;
     } else {
Index: /main/trunk/greenstone2/perllib/mgppbuilder.pm
===================================================================
--- /main/trunk/greenstone2/perllib/mgppbuilder.pm	(revision 28374)
+++ /main/trunk/greenstone2/perllib/mgppbuilder.pm	(revision 28375)
@@ -180,5 +180,5 @@
     
     my $osextra = "";
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	$fulltextprefix =~ s@/@\\@g;
     } 
@@ -419,5 +419,5 @@
 
     my $osextra = "";
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	$fullindexprefix =~ s@/@\\@g;
     } else {
Index: /main/trunk/greenstone2/perllib/plugins/BasePlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/BasePlugin.pm	(revision 28374)
+++ /main/trunk/greenstone2/perllib/plugins/BasePlugin.pm	(revision 28375)
@@ -671,5 +671,4 @@
     print $outhandle "Calling method: $cfilename:$cline $cpackage->$csubr\n";
 
-
     my ($filemeta) = $file =~ /([^\\\/]+)$/; # getting the tail of the filepath (skips all string parts containing slashes upto the end)
     $filemeta = $self->filepath_to_utf8($filemeta, $file_encoding);
@@ -891,5 +890,5 @@
 	# Win32::GetLongFilePath() -- then the underlying file system is UTF16
 
-	if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
+	if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
 	    # Can do better than working with the DOS character encoding returned by locale	    
 	    $deduced_filename_encoding = "unicode";
@@ -963,5 +962,5 @@
     # abbreviated DOS form
 
-    if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
 	if ((defined $filename_encoding) && ($filename_encoding eq "unicode")) {
 	    if (-e $raw_filename) {
Index: /main/trunk/greenstone2/perllib/util.pm
===================================================================
--- /main/trunk/greenstone2/perllib/util.pm	(revision 28374)
+++ /main/trunk/greenstone2/perllib/util.pm	(revision 28375)
@@ -149,5 +149,5 @@
     my $real_filename;
 
-    if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
 	require Win32;
 
@@ -368,5 +368,5 @@
 
     my $join_char;
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	$join_char = ";";
     } else {
@@ -377,5 +377,5 @@
 
     # remove duplicate slashes
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	$pathname =~ s/[\\\/]+/\\/g;
     } else {
@@ -412,5 +412,9 @@
 
     # 64 bit linux can't handle ";" as path separator, so make sure to set this to the right one for the OS
-    my $pathsep = (defined $ENV{'GSDLOS'} && $ENV{'GSDLOS'} !~ m/windows/) ? ":" : ";";
+##    my $pathsep = (defined $ENV{'GSDLOS'} && $ENV{'GSDLOS'} !~ m/windows/) ? ":" : ";";
+
+    # Rewritten above to make ":" the default (Windows is the special
+    # case, anything else 'unusual' such as Solaris etc is Unix)
+    my $pathsep = (defined $ENV{'GSDLOS'} && (($ENV{'GSDLOS'} =~ m/windows/) && ($^O ne "cygwin"))) ? ";" : ":";
 
     # do not prepend any value/path that's already in the environment variable
@@ -462,4 +466,9 @@
     my ($base_dir, $file) = @_;
     
+#    my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(0);
+#    my ($lcfilename) = ($cfilename =~ m/([^\\\/]*)$/);
+#    print STDERR "** Calling method: $lcfilename:$cline $cpackage->$csubr\n";
+
+
     my $filename_full_path = $file;
     # add on directory if present
@@ -477,5 +486,5 @@
     my $filename = shift(@_);
 
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	$filename =~ s/[^\\\\]*$//;
     }
@@ -561,5 +570,5 @@
 {
 	my ($filepath) = @_;
-	if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+	if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 		# Only need to worry about Windows, as Unix style directories already in url-format
 		# Convert Windows style \ => /
@@ -573,5 +582,5 @@
 {
     my ($filepath) = @_;
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	# Only need to worry about Windows, as Unix style directories already in url-format
 	# Convert Windows style \\ => /
@@ -629,5 +638,5 @@
     my $filename_full_path = &FileUtils::filenameConcatenate($base_dir,$file);
 
-    if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
 	require Win32;
 
@@ -651,5 +660,5 @@
     my ($filename_full_path,$and_encode) = @_;
 
-    if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
 	# Ensure any DOS-like filename, such as test~1.txt, has been upgraded
 	# to its long (Windows) version
@@ -673,5 +682,5 @@
     my ($filename_full_path) = @_;
 
-    if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ m/^windows$/i) && ($^O ne "cygwin")) {
 	require Win32;
 
@@ -695,5 +704,5 @@
     my ($block_hash,$filename) = @_;
     
-    if ($ENV{'GSDLOS'} =~ m/^windows$/) {
+    if (($ENV{'GSDLOS'} =~ m/^windows$/) && ($^O ne "cygwin")) {
 	
 	# lower case the entire thing, eg for cover.jpg when its actually cover.JPG
@@ -755,5 +764,5 @@
 sub get_dirsep {
 
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	return "\\";
     } else {
@@ -764,5 +773,5 @@
 sub get_os_dirsep {
 
-    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
+    if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin")) {
 	return "\\\\";
     } else {
@@ -798,5 +807,5 @@
 # .exe, otherwise they don't have to end in any extension
 sub get_os_exe {
-    return ".exe" if $ENV{'GSDLOS'} =~ /^windows$/i;
+    return ".exe" if (($ENV{'GSDLOS'} =~ /^windows$/i) && ($^O ne "cygwin"));
     return "";
 }
@@ -1138,5 +1147,5 @@
 	#my $perl_command = "(cd $GSDLHOME; export GSDLHOME=; . ./setup.bash > /dev/null; env)";
 	my $perl_command = "(cd $GSDLHOME; /bin/bash -c \"export GSDLHOME=; source setup.bash > /dev/null; env\")";		
-	if($GSDLOS =~ m/windows/i) {
+	if (($GSDLOS =~ m/windows/i) && ($^O ne "cygwin"))  {
 		#$perl_command = "cmd /C \"cd $GSDLHOME&& set GSDLHOME=&& setup.bat > nul&& set\"";
 		$perl_command = "(cd $GSDLHOME&& set GSDLHOME=&& setup.bat > nul&& set)";
@@ -1169,5 +1178,5 @@
 	if($ENV{'PERLPATH'}) {
 		# OR: # $perl_exec = &FileUtils::filenameConcatenate($ENV{'PERLPATH'},"perl");
-		if($ENV{'GSDLOS'} =~ m/windows/) {
+		if (($ENV{'GSDLOS'} =~ m/windows/) && ($^O ne "cygwin")) {
 			$perl_exec = "$ENV{'PERLPATH'}\\Perl.exe";
 		} else {
