History

stripped extraneous whitespace from src/

used the following commands: find . -type f -name "*.h" | xargs sed -i 's/\s*$//g' find . -type f -name "*.cpp" | xargs sed -i 's/\s*$//g'

nshaheed committed 4 years ago

Commit e27927b1 parent f4eeefe90 files · +7646 −7646Browse files

Showing the changes to src/core/util_string.cpp (1 of 90 files). Show all

Unified · Split

src/core/util_string.cpp+27−27
@@ -218,30 +218,30 @@ string rtrim( const string & val ) · 217 unmodified lines
218218 // name: extract_args()
219219 // desc: extract argument from format filename:arg1:arg2:etc
220220 //-----------------------------------------------------------------------------
221−t_CKBOOL extract_args( const string & token,
221+t_CKBOOL extract_args( const string & token,
222222 string & filename, vector<string> & args )
223223 {
224224 // clear vector
225225 args.clear();
226226 // clear filename
227227 filename = "";
228−
228+
229229 // last : found pos
230230 t_CKINT prev_pos = 0;
231231 // curr : pos
232232 t_CKINT i = 0;
233−
233+
234234 string tmp;
235−
235+
236236 // copy and trim
237237 string s = trim( token );
238−
238+
239239 // ignore second character as arg separator if its : on Windows
240240 t_CKBOOL ignoreSecond = FALSE;
241241 #ifdef __PLATFORM_WIN32__
242242 ignoreSecond = TRUE;
243243 #endif // __PLATFORM_WIN32__
244−
244+
245245 // detect
246246 t_CKBOOL scan = FALSE;
247247 t_CKBOOL ret = TRUE;
@@ -253,14 +253,14 @@ t_CKBOOL extract_args( const string & token, · 5 unmodified lines
253253 scan = TRUE;
254254 break;
255255 }
256−
256+
257257 // mad...
258258 if( scan )
259259 {
260260 mask = new char[s.length()];
261261 // zero
262262 memset(mask, 0, s.length()*sizeof(char));
263−
263+
264264 // loop through
265265 for( i = 0; i < s.length(); i++ )
266266 {
@@ -271,7 +271,7 @@ t_CKBOOL extract_args( const string & token, · 4 unmodified lines
271271 // mask[i] = 1;
272272 // break; // added 1.3.1.1
273273 // }
274−
274+
275275 // 1.3.2.0: spencer and ge fixed this, requiring \ to escape :
276276 if( s[i] == '\\' && (i+1) < s.length() )
277277 {
@@ -318,15 +318,15 @@ t_CKBOOL extract_args( const string & token, · 40 unmodified lines
318318 ret = FALSE;
319319 goto done;
320320 }
321−
321+
322322 // copy
323323 if( filename == "" )
324324 filename = tmp;
325325 else
326326 args.push_back( tmp );
327−
327+
328328 tmp = "";
329−
329+
330330 // update
331331 prev_pos = i + 1;
332332 }
@@ -334,11 +334,11 @@ t_CKBOOL extract_args( const string & token, · 1 unmodified line
334334 {
335335 tmp.append(1, s[i]);
336336 }
337−
337+
338338 // reset
339339 ignoreNext = FALSE;
340340 }
341−
341+
342342 // get the remainder, if any
343343 if( tmp.length() )
344344 {
@@ -348,7 +348,7 @@ t_CKBOOL extract_args( const string & token, · 3 unmodified lines
348348 else
349349 args.push_back( tmp );
350350 }
351−
351+
352352 // testing code - spencer 1.3.2.0
353353 // CK_FPRINTF_STDERR( "INPUT: %s\n", token.c_str() );
354354 // CK_FPRINTF_STDERR( "FILENAME: %s\n", filename.c_str() );
@@ -467,21 +467,21 @@ std::string globTildePath( const std::string & path ) · 112 unmodified lines
467467 std::string get_full_path( const std::string & fp )
468468 {
469469 #ifndef __PLATFORM_WIN32__
470−
470+
471471 char buf[PATH_MAX];
472472 char * result = realpath(fp.c_str(), buf);
473−
473+
474474 // try with .ck extension
475475 if(result == NULL && !str_endsin(fp.c_str(), ".ck"))
476476 result = realpath((fp + ".ck").c_str(), buf);
477−
477+
478478 if(result == NULL)
479479 return fp;
480480 else
481481 return buf;
482−
482+
483483 #else //
484−
484+
485485 char buf[MAX_PATH];
486486 DWORD result = GetFullPathName(fp.c_str(), MAX_PATH, buf, NULL);
487487
@@ -528,13 +528,13 @@ std::string expand_filepath( std::string & fp, t_CKBOOL ensurePathExists ) · 40 unmodified lines
528528 std::string extract_filepath_dir(std::string &filepath)
529529 {
530530 char path_separator = '/';
531−
531+
532532 //#ifdef __WINDOWS_DS__
533533 // path_separator = '\\';
534534 //#else
535535 // path_separator = '/';
536536 //#endif
537−
537+
538538 // if the last character is a slash, skip it
539539 t_CKINT i = filepath.rfind(path_separator);
540540 // if not separator found, return empty string
@@ -543,7 +543,7 @@ std::string extract_filepath_dir(std::string &filepath) · 2 unmodified lines
543543 // skip any/all extra trailing slashes
544544 while( i > 0 && filepath[i-1] == path_separator )
545545 i--;
546−
546+
547547 // change spencer 2014-7-17: include trailing slash
548548 return std::string(filepath, 0, i+1);
549549 }
@@ -570,7 +570,7 @@ string dir_go_up( const string & dir, t_CKINT numUp ) · 20 unmodified lines
570570 // skip any trailing slashes
571571 while( pos > 0 && dir[pos-1] == path_separator )
572572 pos--;
573−
573+
574574 // loop
575575 while( numUp > 0 )
576576 {
@@ -614,13 +614,13 @@ void parse_path_list( std::string & str, std::list<std::string> & lst ) · 37 unmodified lines
614614 const char separator = ':';
615615 #endif
616616 std::string::size_type i = 0, last = 0;
617− while( last < str.size() &&
617+ while( last < str.size() &&
618618 ( i = str.find( separator, last ) ) != std::string::npos )
619619 {
620620 lst.push_back( str.substr( last, i - last ) );
621621 last = i + 1;
622622 }
623−
623+
624624 lst.push_back( str.substr( last, str.size() - last ) );
625625 }
626626
@@ -660,7 +660,7 @@ t_CKBOOL str_endsin( const char * str, const char * end ) · 33 unmodified lines
660660 {
661661 size_t len = strlen(str);
662662 size_t endlen = strlen(end);
663−
663+
664664 return strncmp(str+(len-endlen), end, endlen) == 0;
665665 }
666666

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t