[PD-cvs] pd/src s_entry.c,1.2,1.2.4.1
Thomas Grill
xovo at users.sourceforge.net
Wed Nov 10 11:52:17 CET 2004
- Previous message: [PD-cvs] pd/src m_simd_sse_gcc.c,1.1.4.1,1.1.4.2
- Next message: [PD-cvs] pd/src d_dac.c,1.3.4.1,1.3.4.2 m_sched.c,1.5.4.1,1.5.4.2 s_audio.c,1.5.4.1,1.5.4.2 s_audio_alsa.c,1.5.4.1,1.5.4.2 s_audio_alsa.h,1.1,1.1.4.1 s_audio_alsamm.c,1.1.4.1,1.1.4.2 s_audio_asio.cpp,1.1.4.8,1.1.4.9 s_audio_jack.c,1.5,1.5.4.1 s_audio_mmio.c,1.4,1.4.4.1 s_audio_oss.c,1.6,1.6.4.1 s_audio_pa.c,1.4,1.4.4.1 s_audio_sgi.c,1.1,1.1.4.1 s_file.c,1.2.4.2,1.2.4.3 s_main.c,1.7.4.1,1.7.4.2 s_stuff.h,1.5.4.1,1.5.4.2 u_main.tk,1.4.4.2,1.4.4.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13205/src
Modified Files:
Tag: devel_0_38
s_entry.c
Log Message:
tokenizing the command line string is sensitive to whitespace - use preparsed __argc and __argv instead
Index: s_entry.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_entry.c,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** s_entry.c 6 Sep 2004 20:20:35 -0000 1.2
--- s_entry.c 10 Nov 2004 10:52:15 -0000 1.2.4.1
***************
*** 2,7 ****
that externs can link back to functions defined in pd. */
- #include <stdio.h>
-
int sys_main(int argc, char **argv);
--- 2,5 ----
***************
*** 9,46 ****
#include <windows.h>
#include <stdio.h>
! #include <malloc.h>
!
! #define MAXARGS 1024
! #define MAXARGLEN 1024
!
! /* jsarlo { */
! int tokenizeCommandLineString(char *clString, char **tokens)
! {
! int i, charCount = 0;
! int tokCount= 0;
! int quoteOpen = 0;
!
! for (i = 0; i < (int)strlen(clString); i++)
! {
! if (clString[i] == '"')
! {
! quoteOpen = !quoteOpen;
! }
! else if (clString[i] == ' ' && !quoteOpen)
! {
! tokens[tokCount][charCount] = 0;
! tokCount++;
! charCount = 0;
! }
! else
! {
! tokens[tokCount][charCount] = clString[i];
! charCount++;
! }
! }
! tokens[tokCount][charCount] = 0;
! tokCount++;
! return tokCount;
! }
int WINAPI WinMain(HINSTANCE hInstance,
--- 7,11 ----
#include <windows.h>
#include <stdio.h>
! #include <stdlib.h>
int WINAPI WinMain(HINSTANCE hInstance,
***************
*** 49,68 ****
int nCmdShow)
{
! int i, argc;
! char *argv[MAXARGS];
!
! __try
{
! for (i = 0; i < MAXARGS; i++)
! {
! argv[i] = (char *)malloc(MAXARGLEN * sizeof(char));
! }
! GetModuleFileName(NULL, argv[0], MAXARGLEN);
! argc = tokenizeCommandLineString(lpCmdLine, argv + 1) + 1;
! sys_main(argc, argv);
! for (i = 0; i < MAXARGS; i++)
! {
! free(argv[i]);
! }
}
__finally
--- 14,20 ----
int nCmdShow)
{
! __try
{
! sys_main(__argc,__argv); /* use preparsed arguments */
}
__finally
***************
*** 72,77 ****
}
- /* } jsarlo */
-
#else /* not MSW */
int main(int argc, char **argv)
--- 24,27 ----
***************
*** 81,83 ****
#endif
-
--- 31,32 ----
- Previous message: [PD-cvs] pd/src m_simd_sse_gcc.c,1.1.4.1,1.1.4.2
- Next message: [PD-cvs] pd/src d_dac.c,1.3.4.1,1.3.4.2 m_sched.c,1.5.4.1,1.5.4.2 s_audio.c,1.5.4.1,1.5.4.2 s_audio_alsa.c,1.5.4.1,1.5.4.2 s_audio_alsa.h,1.1,1.1.4.1 s_audio_alsamm.c,1.1.4.1,1.1.4.2 s_audio_asio.cpp,1.1.4.8,1.1.4.9 s_audio_jack.c,1.5,1.5.4.1 s_audio_mmio.c,1.4,1.4.4.1 s_audio_oss.c,1.6,1.6.4.1 s_audio_pa.c,1.4,1.4.4.1 s_audio_sgi.c,1.1,1.1.4.1 s_file.c,1.2.4.2,1.2.4.3 s_main.c,1.7.4.1,1.7.4.2 s_stuff.h,1.5.4.1,1.5.4.2 u_main.tk,1.4.4.2,1.4.4.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Pd-cvs
mailing list