Thomas Funk <t.f...@web.de> writes: > Dan Espen wrote: >> Thomas Funk <t.f...@web.de> writes: >> >>> Hi! >>> >>> I'm working on a composite configurator with FvwmScript and getting an >>> issue with WriteToFile command. It only writes '#end' into the file. >>> >>> First I thought I've done something wrong but I do the same as in >>> FvwmScript-BaseConfig. So I started a test with FvwmScript-BaseConfig >>> and the same happens. Used FVWM is 2.6.5. This happens under Fedora 19, >>> too. >>> >>> My next thought was something has changed in WriteToFile source since >>> creation of FvwmScript-BaseConfig - 2007-08-07. So I compared the code >>> from 2.5.22 and CVS but nothing has changed. >>> >>> So, what could be the problem? >> >> We'd probably have to see the script but you could always resort to >> adding printfs in Instructions.c. >> >> Start with determining if it gets NbArg right. >> Just seeing #end is an indication that it doesn't >> see the args after the filename. > > I have checked different VMs with different FVWM versions with > FvwmScript-BaseConfig: > > Debian 4.x (2007) with FVWM 2.5.22 - ok, creates full config > Debian 6.x (2011) with FVWM 2.6.0 - ok, creates full config > Debian 7.1 (2013) with FVWM 2.6.6 - ok, creates full config > Debian 7.1 (2013) with FVWM 2.6.5 - ok, creates full config > Debian 8 (testing, 2013) with FVWM 2.6.5 - nok, creates '#end' > Fedora 19 (2013) with FVWM 2.6.5 - nok, creates '#end'
Good stuff! > Dominique Michel wrote: >> I get the same issue yesterday. >> This is with fvwm-2.6.6 from cvs and gentoo. > > So, it seems it's not a script problem. > > Therefore I've starting your suggestion with 'printfs' in instructions.c > under my Fedora VM. I used this FvwmScript with one WriteToFile: > > #WindowTitle {Test WriteToFile} > #WindowSize 470 415 # Taille > # > #Init > #Begin > # Set $userDir = (GetOutput {echo "$FVWM_USERDIR"} 1 -1) > # Set $configPath = $userDir{/bla} > # > # WriteToFile $configPath {This is a test} > # Quit > #End > > As I didn't knew what you meant with 'printfs' I used printf first and > hoped that output went into .xsession-errors. No output appeared but > WriteToFile worked. So I removed printf and compiled code suddenly > worked! > > Same code, different behaviors... > > Therefore I did the same on my Debian 8 system and the compiled version > of FvwmScript works also. > > Under Debian 8 and Fedora 19 I have distribution packages installed. > All others are self compiled. > > Could it be a problem of code optimization? Because the FvwmScript > executables has huge different sizes: > package: 380K > compiled: 1,5M Hmm, I wonder what flags we need to use to get near that size? > The only thing that not fit in this theory is Dominiques issue because > his code is self compiled, too ... I should have said fprintf(stderr....); I put a few in and observed expected behavior. One near the end of CalcArg: fprintf(stderr,"calc arg value of %s\n",TmpStr); One right at the start of WriteToFile: fprintf(stderr,"number of args %d\n",NbArg); What you say above sounds like a very possible optimizer/compiler problem. Probably the distro flags haven't changed so we might need to know the flags and the specific compiler version. BTW, I'm FC19 but I always build my own executables. -- Dan Espen