]> git.lyx.org Git - lyx.git/blob - development/Win32/lyxwin32.C
Citation dialog resized form to fit on a 800x600 screen
[lyx.git] / development / Win32 / lyxwin32.C
1 #include <stdio.h>                         /* standard io library */
2 #include <stdlib.h>                        /* standard library */
3 #include <unistd.h>                        /* sleep , fork & exec */
4 #include <string.h>                        /* standard string library */
5 #include <errno.h>
6
7 int main ( int argc, char *argv[] )
8 {
9 /*char cmd [32000] = "lyx " ; */                   /* user command */
10 char cmd [32000] = "lyx " ;
11 char *nargs [4 ] = { "/bin/bash", "-c" , cmd , NULL } ;   /* execute with login /bin/bash */
12 int i=1;
13
14 putenv ( "BASH_ENV=/etc/lyxprofile" ) ;    /* ensure bash reads my global env changes */
15
16 while ( i < argc )                      /* do for all "real" args */
17    {
18        strcat ( cmd , "\"" ) ;             /* add quote before */
19        strcat ( cmd , argv [ i ] ) ;       /* add the argument */
20        strcat ( cmd , "\" " ) ;            /* add closing quote */
21        i ++ ;
22    }
23
24 strcat ( cmd, "</dev/null 2>/dev/null");
25
26 fprintf ( stderr , "Command is: |%s|\n" , cmd );
27 execv ( "/bin/bash" , nargs ) ;         /* exec sub command */
28
29 /* we should never reach here */
30 fprintf ( stderr , "Execute failed, error = %d\n" , errno ) ;
31 return ( 0 ) ;                          /* exit with no error */
32 }