]> git.lyx.org Git - lyx.git/blobdiff - lib/reLyX/MakePreamble.pm
Menu structure cleanup, configure tweaks
[lyx.git] / lib / reLyX / MakePreamble.pm
index 7a5d6b045455aaf19d5248e307ca03c8c4f97ae9..179aed82c1a6dfb4c733e5ffce2fa92eac5cee4b 100644 (file)
@@ -136,6 +136,7 @@ sub translate_preamble {
     # whoami is needed on Win32, because getlong/getpwuid aren't implemented
     # I'd rather use internal Perl functions when possible, though
     $nm = (eval {getlogin || getpwuid($<)}) || `whoami`;
+    chomp($nm); # whomai returns "foo\n"
     $dt = localtime;
     $LyX_Preamble .= "\#This file was created by <$nm> $dt\n";
     $LyX_Preamble .= "\#LyX 1.0 (C) 1995-1999 Matthias Ettrich " .
@@ -178,7 +179,7 @@ sub translate_preamble {
 
     # Read the document class, in braces, then convert it to a textclass
     # However, if the user input a different class with the -c option, use that
-    s/\s*\{(\w+)\}//;
+    s/\s*\{(\S+)\s*\}//;
     my $class = $1;
     $class = $true_class if $true_class; # override from -c option
     die "no document class in file, no -c option given\n" unless $class;