summaryrefslogtreecommitdiff
path: root/rtl/linux/system.pp
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-10 19:20:48 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-10 19:20:48 +0000
commit160cc1e115eeb75638dce6effdd16b2bc810ddb4 (patch)
treeb791a95695a7cf674e61a6153139c6f9c6c491fa /rtl/linux/system.pp
parent3843727e74b31bbf2a34e7e3b89ee422269f770e (diff)
parent413a6aa6469e6c297780217a27ca91363c637944 (diff)
downloadfpc-avr.tar.gz
* rebase to trunk@17295avr
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/avr@17296 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/linux/system.pp')
-rw-r--r--rtl/linux/system.pp10
1 files changed, 7 insertions, 3 deletions
diff --git a/rtl/linux/system.pp b/rtl/linux/system.pp
index 6508aa42ad..9aae64619e 100644
--- a/rtl/linux/system.pp
+++ b/rtl/linux/system.pp
@@ -33,7 +33,7 @@ Unit System;
{$I sysunixh.inc}
-function get_cmdline:Pchar;
+function get_cmdline:Pchar;
property cmdline:Pchar read get_cmdline;
{$if defined(CPUARM) or defined(CPUM68K)}
@@ -179,6 +179,7 @@ begin
found:=true;
break;
end;
+ found:=found or (len=0); // also quote if len=0, bug 19114
if bufsize+len>=ARG_MAX-2 then
AddBuf;
if found then
@@ -186,8 +187,11 @@ begin
buf[bufsize]:='"';
inc(bufsize);
end;
- move(argv[i]^,buf[bufsize],len);
- inc(bufsize,len);
+ if len>0 then
+ begin
+ move(argv[i]^,buf[bufsize],len);
+ inc(bufsize,len);
+ end;
if found then
begin
buf[bufsize]:='"';