openenvutils/commandshell/shell/commands/ps/src/main.cpp
changeset 69 dcd4152cfe55
parent 0 2e3d3ce01487
equal deleted inserted replaced
65:8a530a83576a 69:dcd4152cfe55
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   257 		
   257 		
   258 			rem = Result.MaxLength() - Result.Length();
   258 			rem = Result.MaxLength() - Result.Length();
   259 			if((fflag))
   259 			if((fflag))
   260 				{
   260 				{
   261 				if(rem<=(proc.FileName()).Length()+5)
   261 				if(rem<=(proc.FileName()).Length()+5)
   262 					Result.ReAlloc((proc.FileName()).Length()+Result.MaxLength());
   262 				    {
       
   263 					c = Result.ReAlloc((proc.FileName()).Length()+Result.MaxLength());
       
   264 					if(c!=KErrNone)
       
   265 					    {
       
   266 					    printf("Error") ;
       
   267 					    exit(1);
       
   268 					    }                   
       
   269 				    }
   263 				Result.AppendFormat(_L(" [%s]"),(proc.FileName()).PtrZ());
   270 				Result.AppendFormat(_L(" [%s]"),(proc.FileName()).PtrZ());
   264 				}
   271 				}
   265 			else 
   272 			else 
   266 				{
   273 				{
   267 				if(rem<=procname.Length())
   274 				if(rem<=procname.Length())
   268 					Result.ReAlloc(procname.Length()+Result.MaxLength());
   275 				    {
       
   276 					c = Result.ReAlloc(procname.Length()+Result.MaxLength());
       
   277 					if(c!=KErrNone)
       
   278 					    {
       
   279 					    printf("Error") ;
       
   280 					    exit(1);
       
   281 					    }					    
       
   282 				    }
   269 				Result.Append(procname);		
   283 				Result.Append(procname);		
   270 				}
   284 				}
   271 				
   285 				
   272 					
   286 					
   273 			}
   287 			}