CINXE.COM
ruby/dir.c at master · ruby/ruby · GitHub
<!DOCTYPE html> <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system"> <head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("https://github.com/ruby/ruby/blob/master/dir.c","20230614175204","https://web.archive.org/","web","/_static/", "1686765124"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://web.archive.org/web/20230614175204/https://github.githubassets.com/"> <link rel="dns-prefetch" href="https://web.archive.org/web/20230614175204/https://avatars.githubusercontent.com/"> <link rel="dns-prefetch" href="https://web.archive.org/web/20230614175204/https://github-cloud.s3.amazonaws.com/"> <link rel="dns-prefetch" href="https://web.archive.org/web/20230614175204/https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://web.archive.org/web/20230614175204/https://github.githubassets.com/" crossorigin> <link rel="preconnect" href="https://web.archive.org/web/20230614175204/https://avatars.githubusercontent.com/"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://web.archive.org/web/20230614175204cs_/https://github.githubassets.com/assets/light-946902aac6a1.css"/><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://web.archive.org/web/20230614175204cs_/https://github.githubassets.com/assets/dark-030e28cb8394.css"/><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-53fac7eeaef0.css"/><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-e7297f24f20e.css"/><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-2c82e49ee788.css"/><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-b3c5f4428be3.css"/><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-b249b3c5ff73.css"/><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-413c5e259397.css"/><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-7690b6bac103.css"/> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://web.archive.org/web/20230614175204cs_/https://github.githubassets.com/assets/primer-primitives-fb1d51d1ef66.css"/> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://web.archive.org/web/20230614175204cs_/https://github.githubassets.com/assets/primer-0e3420bbec16.css"/> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://web.archive.org/web/20230614175204cs_/https://github.githubassets.com/assets/global-a55bf4a27d6d.css"/> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://web.archive.org/web/20230614175204cs_/https://github.githubassets.com/assets/github-b72ad49f5ae2.css"/> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://web.archive.org/web/20230614175204cs_/https://github.githubassets.com/assets/code-75f3d5c8c0e4.css"/> <meta name="optimizely-datafile" content="{"groups": [], "environmentKey": "production", "rollouts": [], "typedAudiences": [], "projectId": "16737760170", "variables": [], "featureFlags": [], "experiments": [], "version": "4", "audiences": [{"conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", "id": "$opt_dummy_audience", "name": "Optimizely-Generated Audience for Backwards Compatibility"}], "anonymizeIP": true, "sdkKey": "WTc6awnGuYDdG98CYRban", "attributes": [{"id": "16822470375", "key": "user_id"}, {"id": "17143601254", "key": "spammy"}, {"id": "18175660309", "key": "organization_plan"}, {"id": "18813001570", "key": "is_logged_in"}, {"id": "19073851829", "key": "geo"}, {"id": "20175462351", "key": "requestedCurrency"}, {"id": "20785470195", "key": "country_code"}, {"id": "21656311196", "key": "opened_downgrade_dialog"}], "botFiltering": false, "accountId": "16737760170", "events": [{"experimentIds": [], "id": "17911811441", "key": "hydro_click.dashboard.teacher_toolbox_cta"}, {"experimentIds": [], "id": "18124116703", "key": "submit.organizations.complete_sign_up"}, {"experimentIds": [], "id": "18145892387", "key": "no_metric.tracked_outside_of_optimizely"}, {"experimentIds": [], "id": "18178755568", "key": "click.org_onboarding_checklist.add_repo"}, {"experimentIds": [], "id": "18180553241", "key": "submit.repository_imports.create"}, {"experimentIds": [], "id": "18186103728", "key": "click.help.learn_more_about_repository_creation"}, {"experimentIds": [], "id": "18188530140", "key": "test_event"}, {"experimentIds": [], "id": "18191963644", "key": "click.empty_org_repo_cta.transfer_repository"}, {"experimentIds": [], "id": "18195612788", "key": "click.empty_org_repo_cta.import_repository"}, {"experimentIds": [], "id": "18210945499", "key": "click.org_onboarding_checklist.invite_members"}, {"experimentIds": [], "id": "18211063248", "key": "click.empty_org_repo_cta.create_repository"}, {"experimentIds": [], "id": "18215721889", "key": "click.org_onboarding_checklist.update_profile"}, {"experimentIds": [], "id": "18224360785", "key": "click.org_onboarding_checklist.dismiss"}, {"experimentIds": [], "id": "18234832286", "key": "submit.organization_activation.complete"}, {"experimentIds": [], "id": "18252392383", "key": "submit.org_repository.create"}, {"experimentIds": [], "id": "18257551537", "key": "submit.org_member_invitation.create"}, {"experimentIds": [], "id": "18259522260", "key": "submit.organization_profile.update"}, {"experimentIds": [], "id": "18564603625", "key": "view.classroom_select_organization"}, {"experimentIds": [], "id": "18568612016", "key": "click.classroom_sign_in_click"}, {"experimentIds": [], "id": "18572592540", "key": "view.classroom_name"}, {"experimentIds": [], "id": "18574203855", "key": "click.classroom_create_organization"}, {"experimentIds": [], "id": "18582053415", "key": "click.classroom_select_organization"}, {"experimentIds": [], "id": "18589463420", "key": "click.classroom_create_classroom"}, {"experimentIds": [], "id": "18591323364", "key": "click.classroom_create_first_classroom"}, {"experimentIds": [], "id": "18591652321", "key": "click.classroom_grant_access"}, {"experimentIds": [], "id": "18607131425", "key": "view.classroom_creation"}, {"experimentIds": [], "id": "18831680583", "key": "upgrade_account_plan"}, {"experimentIds": [], "id": "19064064515", "key": "click.signup"}, {"experimentIds": [], "id": "19075373687", "key": "click.view_account_billing_page"}, {"experimentIds": [], "id": "19077355841", "key": "click.dismiss_signup_prompt"}, {"experimentIds": [], "id": "19079713938", "key": "click.contact_sales"}, {"experimentIds": [], "id": "19120963070", "key": "click.compare_account_plans"}, {"experimentIds": [], "id": "19151690317", "key": "click.upgrade_account_cta"}, {"experimentIds": [], "id": "19424193129", "key": "click.open_account_switcher"}, {"experimentIds": [], "id": "19520330825", "key": "click.visit_account_profile"}, {"experimentIds": [], "id": "19540970635", "key": "click.switch_account_context"}, {"experimentIds": [], "id": "19730198868", "key": "submit.homepage_signup"}, {"experimentIds": [], "id": "19820830627", "key": "click.homepage_signup"}, {"experimentIds": [], "id": "19988571001", "key": "click.create_enterprise_trial"}, {"experimentIds": [], "id": "20036538294", "key": "click.create_organization_team"}, {"experimentIds": [], "id": "20040653299", "key": "click.input_enterprise_trial_form"}, {"experimentIds": [], "id": "20062030003", "key": "click.continue_with_team"}, {"experimentIds": [], "id": "20068947153", "key": "click.create_organization_free"}, {"experimentIds": [], "id": "20086636658", "key": "click.signup_continue.username"}, {"experimentIds": [], "id": "20091648988", "key": "click.signup_continue.create_account"}, {"experimentIds": [], "id": "20103637615", "key": "click.signup_continue.email"}, {"experimentIds": [], "id": "20111574253", "key": "click.signup_continue.password"}, {"experimentIds": [], "id": "20120044111", "key": "view.pricing_page"}, {"experimentIds": [], "id": "20152062109", "key": "submit.create_account"}, {"experimentIds": [], "id": "20165800992", "key": "submit.upgrade_payment_form"}, {"experimentIds": [], "id": "20171520319", "key": "submit.create_organization"}, {"experimentIds": [], "id": "20222645674", "key": "click.recommended_plan_in_signup.discuss_your_needs"}, {"experimentIds": [], "id": "20227443657", "key": "submit.verify_primary_user_email"}, {"experimentIds": [], "id": "20234607160", "key": "click.recommended_plan_in_signup.try_enterprise"}, {"experimentIds": [], "id": "20238175784", "key": "click.recommended_plan_in_signup.team"}, {"experimentIds": [], "id": "20239847212", "key": "click.recommended_plan_in_signup.continue_free"}, {"experimentIds": [], "id": "20251097193", "key": "recommended_plan"}, {"experimentIds": [], "id": "20438619534", "key": "click.pricing_calculator.1_member"}, {"experimentIds": [], "id": "20456699683", "key": "click.pricing_calculator.15_members"}, {"experimentIds": [], "id": "20467868331", "key": "click.pricing_calculator.10_members"}, {"experimentIds": [], "id": "20476267432", "key": "click.trial_days_remaining"}, {"experimentIds": [], "id": "20476357660", "key": "click.discover_feature"}, {"experimentIds": [], "id": "20479287901", "key": "click.pricing_calculator.custom_members"}, {"experimentIds": [], "id": "20481107083", "key": "click.recommended_plan_in_signup.apply_teacher_benefits"}, {"experimentIds": [], "id": "20483089392", "key": "click.pricing_calculator.5_members"}, {"experimentIds": [], "id": "20484283944", "key": "click.onboarding_task"}, {"experimentIds": [], "id": "20484996281", "key": "click.recommended_plan_in_signup.apply_student_benefits"}, {"experimentIds": [], "id": "20486713726", "key": "click.onboarding_task_breadcrumb"}, {"experimentIds": [], "id": "20490791319", "key": "click.upgrade_to_enterprise"}, {"experimentIds": [], "id": "20491786766", "key": "click.talk_to_us"}, {"experimentIds": [], "id": "20494144087", "key": "click.dismiss_enterprise_trial"}, {"experimentIds": [], "id": "20499722759", "key": "completed_all_tasks"}, {"experimentIds": [], "id": "20500710104", "key": "completed_onboarding_tasks"}, {"experimentIds": [], "id": "20513160672", "key": "click.read_doc"}, {"experimentIds": [], "id": "20516196762", "key": "actions_enabled"}, {"experimentIds": [], "id": "20518980986", "key": "click.dismiss_trial_banner"}, {"experimentIds": [], "id": "20535446721", "key": "click.issue_actions_prompt.dismiss_prompt"}, {"experimentIds": [], "id": "20557002247", "key": "click.issue_actions_prompt.setup_workflow"}, {"experimentIds": [], "id": "20595070227", "key": "click.pull_request_setup_workflow"}, {"experimentIds": [], "id": "20626600314", "key": "click.seats_input"}, {"experimentIds": [], "id": "20642310305", "key": "click.decrease_seats_number"}, {"experimentIds": [], "id": "20662990045", "key": "click.increase_seats_number"}, {"experimentIds": [], "id": "20679620969", "key": "click.public_product_roadmap"}, {"experimentIds": [], "id": "20761240940", "key": "click.dismiss_survey_banner"}, {"experimentIds": [], "id": "20767210721", "key": "click.take_survey"}, {"experimentIds": [], "id": "20795281201", "key": "click.archive_list"}, {"experimentIds": [], "id": "20966790249", "key": "contact_sales.submit"}, {"experimentIds": [], "id": "20996500333", "key": "contact_sales.existing_customer"}, {"experimentIds": [], "id": "20996890162", "key": "contact_sales.blank_message_field"}, {"experimentIds": [], "id": "21000470317", "key": "contact_sales.personal_email"}, {"experimentIds": [], "id": "21002790172", "key": "contact_sales.blank_phone_field"}, {"experimentIds": [], "id": "21354412592", "key": "click.dismiss_create_readme"}, {"experimentIds": [], "id": "21366102546", "key": "click.dismiss_zero_user_content"}, {"experimentIds": [], "id": "21370252505", "key": "account_did_downgrade"}, {"experimentIds": [], "id": "21370840408", "key": "click.cta_create_readme"}, {"experimentIds": [], "id": "21375451068", "key": "click.cta_create_new_repository"}, {"experimentIds": [], "id": "21385390948", "key": "click.zero_user_content"}, {"experimentIds": [], "id": "21467712175", "key": "click.downgrade_keep"}, {"experimentIds": [], "id": "21484112202", "key": "click.downgrade"}, {"experimentIds": [], "id": "21495292213", "key": "click.downgrade_survey_exit"}, {"experimentIds": [], "id": "21508241468", "key": "click.downgrade_survey_submit"}, {"experimentIds": [], "id": "21512030356", "key": "click.downgrade_support"}, {"experimentIds": [], "id": "21539090022", "key": "click.downgrade_exit"}, {"experimentIds": [], "id": "21543640644", "key": "click_fetch_upstream"}, {"experimentIds": [], "id": "21646510300", "key": "click.move_your_work"}, {"experimentIds": [], "id": "21656151116", "key": "click.add_branch_protection_rule"}, {"experimentIds": [], "id": "21663860599", "key": "click.downgrade_dialog_open"}, {"experimentIds": [], "id": "21687860483", "key": "click.learn_about_protected_branches"}, {"experimentIds": [], "id": "21689050333", "key": "click.dismiss_protect_this_branch"}, {"experimentIds": [], "id": "21864370109", "key": "click.sign_in"}], "revision": "1372"}"/> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/wp-runtime-6cbf11833d9c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_stacktrace-parser_dist_stack-trace-parser_esm_js-node_modules_github_bro-a4c183-ae93d3fba59c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/ui_packages_soft-nav_soft-nav_ts-899d6d5b0d82.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/environment-07edc14d05eb.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-2646a2c533e3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-99e288659d4f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_markdown-toolbar-element_dist_index_js-496d76cca51c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_auto-complete-element-5b3870-ff38694180c6.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_text-ex-3415a8-7ecc10fb88d0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-d1569f-eb0e0c1e5438.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_primer_view-components_app_components_primer_primer_js-node_modules_gith-3af896-d8cf3e5f5813.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/github-elements-895dc242ef37.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/element-registry-28586a0578cf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-9d9fe1859ce5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_morphdom_dist_morphdom-esm_js-b1fdd7158cf0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_alive-client_dist-bf5aa2-424aa982deef.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-ba0e4d5b3207.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-node_modules_github_jtml_lib_index_js-40bf234a19dc.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_scroll-anchoring_dist_scro-52dc4b-e1e33bfc0b7e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_paste-markdown_dist_index_esm_js-node_modules_github_quote-select-0ea842-0c42838a12e3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_updatable-content_ts-88070db28a55.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_behaviors_keyboard-shortcuts-helper_ts-app_assets_modules_github_be-f5afdb-3a77a772cd4d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-050ad6637d58.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-2e2258-7effad8d88d4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-f22ac6b94445.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_blob-anchor_ts-app_assets_modules_github_filter-sort_ts-app_assets_-e5f169-c54621d9e188.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/behaviors-1a717cbc6bde.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-623425af41e1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/notifications-global-0104a8043aa4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_optimizely_optimizely-sdk_dist_optimizely_browser_es_min_js-node_modules-089adc-2328ba323205.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/optimizely-c6fa9687eddf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_template-parts_lib_index_js-677582870bfd.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_decorators_js-node_modules_github_remote-form_-e3de2b-779fd9166293.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_filter--b2311f-15fe0f17a114.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-0e2b12902d39.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/repositories-71781dca4d5e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_clipboard-copy-element_dist_index_esm_js-node_modules_scroll-anch-c93c97-d63d35dd5d0b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/app_assets_modules_github_diffs_blob-lines_ts-app_assets_modules_github_diffs_linkable-line-n-f96c66-97aade341120.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/diffs-eb2ed5392d42.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/code-menu-7dfb8cccdca1.js"></script> <title>ruby/dir.c at master · ruby/ruby · GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/blob/*name(/*path)"> <meta name="current-catalog-service-hash" content="82c569b93da5c18ed649ebd4c2c79437db4611a6a1373e805a3cb001c64130b7"> <meta name="request-id" content="89BC:73F2:103CBA40:1793748C:6489FE44" data-pjax-transient="true"/><meta name="html-safe-nonce" content="af160b18ead23f56194c2e9e259922693d44d0780bccffb2212684d5d60c978c" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6Imh0dHBzOi8vZ2l0aHViLmNvbS9ydWJ5L3J1YnkiLCJyZXF1ZXN0X2lkIjoiODlCQzo3M0YyOjEwM0NCQTQwOjE3OTM3NDhDOjY0ODlGRTQ0IiwidmlzaXRvcl9pZCI6IjU1NDMxMjI1Mjk0ODY5ODAxNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="8eea6b6a6d5888220afc62b3a4201b1d7bc1498012a11f0cfcfb31747ddef0b5" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:538746" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree" data-turbo-transient="true"/> <meta name="selected-link" value="repo_source" data-turbo-transient> <link rel="assets" href="https://github.githubassets.com/"> <meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY"> <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect"/> <meta name="analytics-location" content="/<user-name>/<repo-name>/blob/show" data-turbo-transient="true"/> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="The Ruby Programming Language. Contribute to ruby/ruby development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/web/20230614175204/https://github.com/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905"/> <meta name="twitter:image:src" content="https://opengraph.githubassets.com/d2bc089a50d838c27ba01b1b38ddb114bd5e425dbca4a3fe7c67b3ea2f41d1fe/ruby/ruby"/><meta name="twitter:site" content="@github"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="ruby/dir.c at master · ruby/ruby"/><meta name="twitter:description" content="The Ruby Programming Language. Contribute to ruby/ruby development by creating an account on GitHub."/> <meta property="og:image" content="https://web.archive.org/web/20230614175204im_/https://opengraph.githubassets.com/d2bc089a50d838c27ba01b1b38ddb114bd5e425dbca4a3fe7c67b3ea2f41d1fe/ruby/ruby"/><meta property="og:image:alt" content="The Ruby Programming Language. Contribute to ruby/ruby development by creating an account on GitHub."/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="600"/><meta property="og:site_name" content="GitHub"/><meta property="og:type" content="object"/><meta property="og:title" content="ruby/dir.c at master · ruby/ruby"/><meta property="og:url" content="https://web.archive.org/web/20230614175204/https://github.com/ruby/ruby"/><meta property="og:description" content="The Ruby Programming Language. Contribute to ruby/ruby development by creating an account on GitHub."/> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta name="enabled-features" content="TURBO_EXPERIMENT_RISKY,IMAGE_METRIC_TRACKING,GEOJSON_AZURE_MAPS,SUDO_MODAL_FOCUS"> <meta http-equiv="x-pjax-version" content="f153b09415c619c01ae942c737ccb922afb70600dea9b5911f4e3175583449d1" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="0db263f9a873141d8256f783c35f244c06d490aacc3b680f99794dd8fd59fb59" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="777da4809024fa2da24c8f5c02971d28ee10e90763c458fcb53587a0345f7501" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="de338eb57597c5f3ae442f746d5806dccbf8283c93c74ea5c592a6181132965a" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/ruby/ruby git https://github.com/ruby/ruby.git"> <meta name="octolytics-dimension-user_id" content="210414"/><meta name="octolytics-dimension-user_login" content="ruby"/><meta name="octolytics-dimension-repository_id" content="538746"/><meta name="octolytics-dimension-repository_nwo" content="ruby/ruby"/><meta name="octolytics-dimension-repository_public" content="true"/><meta name="octolytics-dimension-repository_is_fork" content="false"/><meta name="octolytics-dimension-repository_network_root_id" content="538746"/><meta name="octolytics-dimension-repository_network_root_nwo" content="ruby/ruby"/> <link rel="canonical" href="https://web.archive.org/web/20230614175204/https://github.com/ruby/ruby/blob/master/dir.c" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive page-blob"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="browser-optimizely-client-errors-url" content="https://api.github.com/_private/browser/optimizely_client/errors"> <link rel="mask-icon" href="https://web.archive.org/web/20230614175204im_/https://github.githubassets.com/pinned-octocat.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://web.archive.org/web/20230614175204im_/https://github.githubassets.com/favicons/favicon.svg"> <meta name="theme-color" content="#1e2327"> <meta name="color-scheme" content="light dark"/> <link rel="manifest" href="/web/20230614175204/https://github.com/manifest.json" crossorigin="use-credentials"> </head> <body class="logged-out env-production page-responsive page-blob" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive page-blob" style="word-wrap: break-word;"> <div class="position-relative js-header-wrapper "> <a href="#start-of-content" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a> <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full"> <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span> </span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_github_memoize_dist_esm_in-687f35-d131f0b6de8e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://web.archive.org/web/20230614175204js_/https://github.githubassets.com/assets/sessions-2638decb9ee5.js"></script> <header class="Header-old header-logged-out js-details-container Details position-relative f4 py-3" role="banner"> <button type="button" class="Header-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span class="d-none">Toggle navigation</span> </button> <div class="container-xl d-flex flex-column flex-lg-row flex-items-center p-responsive height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <a class="mr-lg-3 color-fg-inherit flex-order-2" href="https://web.archive.org/web/20230614175204/https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark"> <svg height="32" aria-hidden="true" viewbox="0 0 16 16" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path> </svg> </a> <div class="flex-1"> <a href="/web/20230614175204/https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fblob%2Fshow&source=header-repo" class="d-inline-block d-lg-none flex-order-1 f5 no-underline border color-border-default rounded-2 px-2 py-1 color-fg-inherit" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="b40051f259e853e24d988cbc88c03a85b0df331ed35a95ce5e052f949f412f4c"> Sign up </a> </div> <div class="flex-1 flex-order-2 text-right"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span class="Button-content"> <span class="Button-label"><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span> </button> </div> </div> <div class="HeaderMenu--logged-out p-responsive height-fit position-lg-relative d-lg-flex flex-column flex-auto pt-7 pb-4 top-0"> <div class="header-menu-wrapper d-flex flex-column flex-self-end flex-lg-row flex-justify-between flex-auto p-3 p-lg-0 rounded rounded-lg-0 mt-3 mt-lg-0"> <nav class="mt-0 px-3 px-lg-0 mb-3 mb-lg-0" aria-label="Global"> <ul class="d-lg-flex list-style-none"> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex dropdown-menu-wide"> <div class="px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <ul class="list-style-none f5"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center pb-lg-3" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Actions","label":"ref_cta:Actions;"}" href="/web/20230614175204/https://github.com/features/actions"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path> </svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center pb-lg-3" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Packages","label":"ref_cta:Packages;"}" href="/web/20230614175204/https://github.com/features/packages"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-package color-fg-subtle mr-3"> <path d="M12.876.64V.639l8.25 4.763c.541.313.875.89.875 1.515v9.525a1.75 1.75 0 0 1-.875 1.516l-8.25 4.762a1.748 1.748 0 0 1-1.75 0l-8.25-4.763a1.75 1.75 0 0 1-.875-1.515V6.917c0-.625.334-1.202.875-1.515L11.126.64a1.748 1.748 0 0 1 1.75 0Zm-1 1.298L4.251 6.34l7.75 4.474 7.75-4.474-7.625-4.402a.248.248 0 0 0-.25 0Zm.875 19.123 7.625-4.402a.25.25 0 0 0 .125-.216V7.639l-7.75 4.474ZM3.501 7.64v8.803c0 .09.048.172.125.216l7.625 4.402v-8.947Z"></path> </svg> <div> <div class="color-fg-default h4">Packages</div> Host and manage packages </div> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center pb-lg-3" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Security","label":"ref_cta:Security;"}" href="/web/20230614175204/https://github.com/features/security"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center pb-lg-3" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Codespaces","label":"ref_cta:Codespaces;"}" href="/web/20230614175204/https://github.com/features/codespaces"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center pb-lg-3" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Copilot","label":"ref_cta:Copilot;"}" href="/web/20230614175204/https://github.com/features/copilot"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M9.75 14a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Zm4.5 0a.75.75 0 0 1 .75.75v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 .75-.75Z"></path><path d="M12 2c2.214 0 4.248.657 5.747 1.756.136.099.268.204.397.312.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086l.633 1.478.043.022A4.75 4.75 0 0 1 24 15.222v1.028c0 .529-.309.987-.565 1.293-.28.336-.636.653-.966.918a13.84 13.84 0 0 1-1.299.911l-.024.015-.006.004-.039.025c-.223.135-.45.264-.68.386-.46.245-1.122.571-1.941.895C16.845 21.344 14.561 22 12 22c-2.561 0-4.845-.656-6.479-1.303a19.046 19.046 0 0 1-1.942-.894 14.081 14.081 0 0 1-.535-.3l-.144-.087-.04-.025-.006-.004-.024-.015a13.16 13.16 0 0 1-1.299-.911 6.913 6.913 0 0 1-.967-.918C.31 17.237 0 16.779 0 16.25v-1.028a4.75 4.75 0 0 1 2.626-4.248l.043-.022.633-1.478a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.498 1.132-3.368.397-.406.89-.717 1.474-.952.129-.108.261-.213.397-.312C7.752 2.657 9.786 2 12 2Zm-8 9.654v6.669a17.59 17.59 0 0 0 2.073.98C7.595 19.906 9.686 20.5 12 20.5c2.314 0 4.405-.594 5.927-1.197a17.59 17.59 0 0 0 2.073-.98v-6.669l-.038-.09c-.046.061-.095.12-.145.177-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.544-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.344a4.323 4.323 0 0 1-.355.508C10.704 12.456 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a3.026 3.026 0 0 1-.145-.177Zm6.309-1.092c.445-.547.708-1.334.851-2.301.057-.357.087-.718.09-1.079v-.031c-.001-.762-.166-1.26-.43-1.568l-.008-.01c-.341-.391-1.046-.689-2.533-.529-1.505.163-2.347.537-2.824 1.024-.462.473-.705 1.18-.705 2.32 0 .605.044 1.087.135 1.472.092.384.231.672.423.89.365.413 1.084.75 2.657.75.91 0 1.527-.223 1.964-.564.14-.11.268-.235.38-.374Zm2.504-2.497c.136 1.057.403 1.913.878 2.497.442.545 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.151.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.318-.862-2.824-1.025-1.487-.161-2.192.139-2.533.529-.268.308-.437.808-.438 1.578v.02c.002.299.023.598.063.894Z"></path> </svg> <div> <div class="color-fg-default h4">Copilot</div> Write better code with AI </div> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center pb-lg-3" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Code review","label":"ref_cta:Code review;"}" href="/web/20230614175204/https://github.com/features/code-review"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code review</div> Manage code changes </div> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center pb-lg-3" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Issues","label":"ref_cta:Issues;"}" href="/web/20230614175204/https://github.com/features/issues"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path> </svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Discussions","label":"ref_cta:Discussions;"}" href="/web/20230614175204/https://github.com/features/discussions"> <svg aria-hidden="true" height="24" viewbox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> </a></li> </ul> </div> <div class="px-lg-4"> <span class="d-block h4 color-fg-default my-1" id="product-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="product-explore-heading"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to All features","label":"ref_cta:All features;"}" href="/web/20230614175204/https://github.com/features"> All features </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" target="_blank" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Documentation","label":"ref_cta:Documentation;"}" href="https://web.archive.org/web/20230614175204/https://docs.github.com/"> Documentation <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" target="_blank" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to GitHub Skills","label":"ref_cta:GitHub Skills;"}" href="https://web.archive.org/web/20230614175204/https://skills.github.com/"> GitHub Skills <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" target="_blank" data-analytics-event="{"category":"Header dropdown (logged out), Product","action":"click to go to Blog","label":"ref_cta:Blog;"}" href="https://web.archive.org/web/20230614175204/https://github.blog/"> Blog <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div class="border-bottom pb-3 mb-3"> <span class="d-block h4 color-fg-default my-1" id="solutions-for-heading">For</span> <ul class="list-style-none f5" aria-labelledby="solutions-for-heading"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to Enterprise","label":"ref_cta:Enterprise;"}" href="/web/20230614175204/https://github.com/enterprise"> Enterprise </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to Teams","label":"ref_cta:Teams;"}" href="/web/20230614175204/https://github.com/team"> Teams </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to Startups","label":"ref_cta:Startups;"}" href="/web/20230614175204/https://github.com/enterprise/startups"> Startups </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" target="_blank" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to Education","label":"ref_cta:Education;"}" href="https://web.archive.org/web/20230614175204/https://education.github.com/"> Education <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> <div class="border-bottom pb-3 mb-3"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-solution-heading">By Solution</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-solution-heading"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to CI/CD &amp; Automation","label":"ref_cta:CI/CD &amp; Automation;"}" href="/web/20230614175204/https://github.com/solutions/ci-cd/"> CI/CD & Automation </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" target="_blank" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to DevOps","label":"ref_cta:DevOps;"}" href="https://web.archive.org/web/20230614175204/https://resources.github.com/devops/"> DevOps <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" target="_blank" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to DevSecOps","label":"ref_cta:DevSecOps;"}" href="https://web.archive.org/web/20230614175204/https://resources.github.com/devops/fundamentals/devsecops/"> DevSecOps <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> <div class=""> <span class="d-block h4 color-fg-default my-1" id="solutions-case-studies-heading">Case Studies</span> <ul class="list-style-none f5" aria-labelledby="solutions-case-studies-heading"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to Customer Stories","label":"ref_cta:Customer Stories;"}" href="/web/20230614175204/https://github.com/customer-stories"> Customer Stories </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" target="_blank" data-analytics-event="{"category":"Header dropdown (logged out), Solutions","action":"click to go to Resources","label":"ref_cta:Resources;"}" href="https://web.archive.org/web/20230614175204/https://resources.github.com/"> Resources <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-3 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 py-2 py-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 px-lg-4"> <div class="border-bottom pb-3 mb-3"> <ul class="list-style-none f5"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center" data-analytics-event="{"category":"Header dropdown (logged out), Open Source","action":"click to go to GitHub Sponsors","label":"ref_cta:GitHub Sponsors;"}" href="/web/20230614175204/https://github.com/sponsors"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> </a></li> </ul> </div> <div class="border-bottom pb-3 mb-3"> <ul class="list-style-none f5"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center" data-analytics-event="{"category":"Header dropdown (logged out), Open Source","action":"click to go to The ReadME Project","label":"ref_cta:The ReadME Project;"}" href="/web/20230614175204/https://github.com/readme"> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> </a></li> </ul> </div> <div class=""> <span class="d-block h4 color-fg-default my-1" id="open-source-repositories-heading">Repositories</span> <ul class="list-style-none f5" aria-labelledby="open-source-repositories-heading"> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Open Source","action":"click to go to Topics","label":"ref_cta:Topics;"}" href="/web/20230614175204/https://github.com/topics"> Topics </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Open Source","action":"click to go to Trending","label":"ref_cta:Trending;"}" href="/web/20230614175204/https://github.com/trending"> Trending </a></li> <li> <a class="HeaderMenu-dropdown-link lh-condensed d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"category":"Header dropdown (logged out), Open Source","action":"click to go to Collections","label":"ref_cta:Collections;"}" href="/web/20230614175204/https://github.com/collections"> Collections </a></li> </ul> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <a class="HeaderMenu-link no-underline px-0 px-lg-2 py-3 py-lg-2 d-block d-lg-inline-block" data-analytics-event="{"category":"Header menu top item (logged out)","action":"click to go to Pricing","label":"ref_cta:Pricing;"}" href="/web/20230614175204/https://github.com/pricing">Pricing</a> </li> </ul> </nav> <div class="d-lg-flex flex-items-center px-3 px-lg-0 mb-3 mb-lg-0 text-center text-lg-left"> <div class="d-lg-flex min-width-0 mb-2 mb-lg-0"> <div class="header-search flex-auto position-relative js-site-search flex-self-stretch flex-md-self-auto mb-3 mb-md-0 mr-0 mr-md-3 scoped-search site-scoped-search js-jump-to"> <div class="position-relative"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="538746" data-scoped-search-url="/ruby/ruby/search" data-owner-scoped-search-url="/orgs/ruby/search" data-unscoped-search-url="/search" data-turbo="false" action="/web/20230614175204/https://github.com/ruby/ruby/search" accept-charset="UTF-8" method="get"> <label class="form-control header-search-wrapper input-sm p-0 js-chromeless-input-container header-search-wrapper-jump-to position-relative d-flex flex-justify-between flex-items-center"> <input type="text" class="form-control js-site-search-focus header-search-input jump-to-field js-jump-to-field js-site-search-field is-clearable" data-hotkey="s,/" name="q" placeholder="Search" data-unscoped-placeholder="Search GitHub" data-scoped-placeholder="Search" autocapitalize="off" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-autocomplete="list" aria-controls="jump-to-results" aria-label="Search" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" spellcheck="false" autocomplete="off"> <input type="hidden" data-csrf="true" class="js-data-jump-to-suggestions-path-csrf" value="lR2Su0/rAQmjstWfWIRtacnJ95rIW5tNupkHGQ/Y9ydaQDphV+mnDW4Murc+3GWnGmsdPJ7NjsjYYvJlvxCzVA=="/> <input type="hidden" class="js-site-search-type-field" name="type"> <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1 header-search-key-slash"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> <div class="Box position-absolute overflow-hidden d-none jump-to-suggestions js-jump-to-suggestions-container"> <ul class="d-none js-jump-to-suggestions-template-container"> <li class="d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-suggestion" role="option"> <a tabindex="-1" class="no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path js-jump-to-suggestion-path js-navigation-open p-2" href="" data-item-type="suggestion"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <svg title="Project" aria-label="Project" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> <svg title="Search" aria-label="Search" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <img class="avatar mr-2 flex-shrink-0 js-jump-to-suggestion-avatar d-none" alt="" aria-label="Team" src="/web/20230614175204im_/https://github.com/ruby/ruby/blob/master/dir.c" width="28" height="28"> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span class="js-jump-to-badge-search-text-default d-none" aria-label="in this repository"> In this repository </span> <span class="js-jump-to-badge-search-text-global d-none" aria-label="in all of GitHub"> All GitHub </span> <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span class="d-inline-block ml-1 v-align-middle">↵</span> </div> </a> </li> </ul> <ul class="d-none js-jump-to-no-results-template-container"> <li class="d-flex flex-justify-center flex-items-center f5 d-none js-jump-to-suggestion p-2"> <span class="color-fg-muted">No suggested jump to results</span> </li> </ul> <ul id="jump-to-results" role="listbox" class="p-0 m-0 js-navigation-container jump-to-suggestions-results-container js-jump-to-suggestions-results-container"> <li class="d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-scoped-search d-none" role="option"> <a tabindex="-1" class="no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path js-jump-to-suggestion-path js-navigation-open p-2" href="" data-item-type="scoped_search"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <svg title="Project" aria-label="Project" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> <svg title="Search" aria-label="Search" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <img class="avatar mr-2 flex-shrink-0 js-jump-to-suggestion-avatar d-none" alt="" aria-label="Team" src="/web/20230614175204im_/https://github.com/ruby/ruby/blob/master/dir.c" width="28" height="28"> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span class="js-jump-to-badge-search-text-default d-none" aria-label="in this repository"> In this repository </span> <span class="js-jump-to-badge-search-text-global d-none" aria-label="in all of GitHub"> All GitHub </span> <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span class="d-inline-block ml-1 v-align-middle">↵</span> </div> </a> </li> <li class="d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-owner-scoped-search d-none" role="option"> <a tabindex="-1" class="no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path js-jump-to-suggestion-path js-navigation-open p-2" href="" data-item-type="owner_scoped_search"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <svg title="Project" aria-label="Project" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> <svg title="Search" aria-label="Search" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <img class="avatar mr-2 flex-shrink-0 js-jump-to-suggestion-avatar d-none" alt="" aria-label="Team" src="/web/20230614175204im_/https://github.com/ruby/ruby/blob/master/dir.c" width="28" height="28"> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span class="js-jump-to-badge-search-text-default d-none" aria-label="in this organization"> In this organization </span> <span class="js-jump-to-badge-search-text-global d-none" aria-label="in all of GitHub"> All GitHub </span> <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span class="d-inline-block ml-1 v-align-middle">↵</span> </div> </a> </li> <li class="d-flex flex-justify-start flex-items-center p-0 f5 navigation-item js-navigation-item js-jump-to-global-search d-none" role="option"> <a tabindex="-1" class="no-underline d-flex flex-auto flex-items-center jump-to-suggestions-path js-jump-to-suggestion-path js-navigation-open p-2" href="" data-item-type="global_search"> <div class="jump-to-octicon js-jump-to-octicon flex-shrink-0 mr-2 text-center d-none"> <svg title="Repository" aria-label="Repository" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo js-jump-to-octicon-repo d-none flex-shrink-0"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <svg title="Project" aria-label="Project" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project js-jump-to-octicon-project d-none flex-shrink-0"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> <svg title="Search" aria-label="Search" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search js-jump-to-octicon-search d-none flex-shrink-0"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <img class="avatar mr-2 flex-shrink-0 js-jump-to-suggestion-avatar d-none" alt="" aria-label="Team" src="/web/20230614175204im_/https://github.com/ruby/ruby/blob/master/dir.c" width="28" height="28"> <div class="jump-to-suggestion-name js-jump-to-suggestion-name flex-auto overflow-hidden text-left no-wrap css-truncate css-truncate-target"> </div> <div class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none js-jump-to-badge-search"> <span class="js-jump-to-badge-search-text-default d-none" aria-label="in this repository"> In this repository </span> <span class="js-jump-to-badge-search-text-global d-none" aria-label="in all of GitHub"> All GitHub </span> <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span> </div> <div aria-hidden="true" class="border rounded-2 flex-shrink-0 color-bg-subtle px-1 color-fg-muted ml-1 f6 d-none d-on-nav-focus js-jump-to-badge-jump"> Jump to <span class="d-inline-block ml-1 v-align-middle">↵</span> </div> </a> </li> </ul> </div> </label> </form> </div> </div> </div> <div class="position-relative mr-lg-3 d-lg-inline-block"> <a href="/web/20230614175204/https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fruby%2Fruby%2Fblob%2Fmaster%2Fdir.c" class="HeaderMenu-link HeaderMenu-link--sign-in flex-shrink-0 no-underline d-block d-lg-inline-block border border-lg-0 rounded rounded-lg-0 p-2 p-lg-0" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="7cfa525e5e36b652234a84ff4c280ff790bad534559104c6de2309e52136eb4f" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in"> Sign in </a> </div> <a href="/web/20230614175204/https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fblob%2Fshow&source=header-repo&source_repo=ruby%2Fruby" class="HeaderMenu-link HeaderMenu-link--sign-up flex-shrink-0 d-none d-lg-inline-block no-underline border color-border-default rounded px-2 py-1" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="7cfa525e5e36b652234a84ff4c280ff790bad534559104c6de2309e52136eb4f" data-analytics-event="{"category":"Sign up","action":"click to sign up for account","label":"ref_page:/<user-name>/<repo-name>/blob/show;ref_cta:Sign up;ref_loc:header logged out"}"> Sign up </a> </div> </div> </div> </div> </header> <div hidden="hidden" data-view-component="true" class="js-stale-session-flash flash flash-warn mb-3"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a href="">Reload</a> to refresh your session.</span> <button class="flash-close js-flash-close" type="button" aria-label="Close"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> </div> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div class="px-2"> <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div> </div> </template> </div> <include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled> <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container"> <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--color-page-header-bg);" data-turbo-replace> <div class="d-flex flex-wrap flex-justify-end mb-3 px-3 px-md-4 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit mr-3"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <span class="author flex-self-stretch" itemprop="author"> <a class="url fn" rel="author" data-hovercard-type="organization" data-hovercard-url="/orgs/ruby/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/web/20230614175204/https://github.com/ruby"> ruby </a> </span> <span class="mx-1 flex-self-stretch color-fg-muted">/</span> <strong itemprop="name" class="mr-2 flex-self-stretch"> <a data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/web/20230614175204/https://github.com/ruby/ruby">ruby</a> </strong> <span></span><span class="Label Label--secondary v-align-middle mr-1">Public</span> </div> </div> <div id="repository-details-container" data-turbo-replace> <ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;"> <li> <a href="/web/20230614175204/https://github.com/login?return_to=%2Fruby%2Fruby" rel="nofollow" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"notification subscription menu watch","repository_id":null,"auth_type":"LOG_IN","originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="1ab68f54dc4209be26b12fa58927609146822dcbb7195531150bd01942cb01c0" aria-label="You must be signed in to change notification settings" data-view-component="true" class="tooltipped tooltipped-s btn-sm btn"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> </li> <li> <a icon="repo-forked" id="fork-button" href="/web/20230614175204/https://github.com/login?return_to=%2Fruby%2Fruby" rel="nofollow" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"repo details fork button","repository_id":538746,"auth_type":"LOG_IN","originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="30384f50564e428a5c22d57e40e36dd7bd5728175e7f57e7e7843173ea760885" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg>Fork <span id="repo-network-counter" data-pjax-replace="true" data-turbo-replace="true" title="5,347" data-view-component="true" class="Counter">5.3k</span> </a> </li> <li> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/web/20230614175204/https://github.com/login?return_to=%2Fruby%2Fruby" rel="nofollow" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"star button","repository_id":538746,"auth_type":"LOG_IN","originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="a2dd8ded20613d88558719394ebdca062f6910e105bf3cc1a230b7b5d0a53fc9" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-s btn-sm btn BtnGroup-item"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> <span id="repo-stars-counter-star" aria-label="20457 users starred this repository" data-singular-suffix="user starred this repository" data-plural-suffix="users starred this repository" data-turbo-replace="true" title="20,457" data-view-component="true" class="Counter js-social-count">20.5k</span> </a> <button disabled="disabled" aria-label="You must be signed in to add this repository to a list" type="button" data-view-component="true" class="btn-sm btn BtnGroup-item px-2"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down"> <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path> </svg> </button></div> </li> </ul> </div> </div> <div id="responsive-meta-container" data-turbo-replace> </div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <ul data-view-component="true" class="UnderlineNav-body list-style-none"> <li data-view-component="true" class="d-inline-flex"> <a id="code-tab" href="/web/20230614175204/https://github.com/ruby/ruby" data-tab-item="i0code-tab" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments /ruby/ruby" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g c" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Code","target":"UNDERLINE_NAV.TAB"}" aria-current="page" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item selected"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> <span data-content="Code">Code</span> <span id="code-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="pull-requests-tab" href="/web/20230614175204/https://github.com/ruby/ruby/pulls" data-tab-item="i1pull-requests-tab" data-selected-links="repo_pulls checks /ruby/ruby/pulls" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g p" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Pull requests","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> <span data-content="Pull requests">Pull requests</span> <span id="pull-requests-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="384" data-view-component="true" class="Counter">384</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="actions-tab" href="/web/20230614175204/https://github.com/ruby/ruby/actions" data-tab-item="i2actions-tab" data-selected-links="repo_actions /ruby/ruby/actions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g a" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Actions","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> <span data-content="Actions">Actions</span> <span id="actions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="wiki-tab" href="/web/20230614175204/https://github.com/ruby/ruby/wiki" data-tab-item="i3wiki-tab" data-selected-links="repo_wiki /ruby/ruby/wiki" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g w" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Wiki","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> <span data-content="Wiki">Wiki</span> <span id="wiki-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="security-tab" href="/web/20230614175204/https://github.com/ruby/ruby/security" data-tab-item="i4security-tab" data-selected-links="security overview alerts policy token_scanning code_scanning /ruby/ruby/security" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g s" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Security","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span data-content="Security">Security</span> <include-fragment src="/ruby/ruby/security/overall-count" accept="text/fragment+html"></include-fragment> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="insights-tab" href="/web/20230614175204/https://github.com/ruby/ruby/pulse" data-tab-item="i5insights-tab" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /ruby/ruby/pulse" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Insights","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> <span data-content="Insights">Insights</span> <span id="insights-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> </ul> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <details data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true"> <div class="UnderlineNav-item mr-0 border-0"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> <span class="sr-only">More</span> </div> </summary> <details-menu role="menu" data-view-component="true" class="dropdown-menu dropdown-menu-sw"> <ul> <li data-menu-item="i0code-tab" hidden> <a role="menuitem" class="js-selected-navigation-item selected dropdown-item" aria-current="page" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments /ruby/ruby" href="/web/20230614175204/https://github.com/ruby/ruby"> Code </a> </li> <li data-menu-item="i1pull-requests-tab" hidden> <a role="menuitem" class="js-selected-navigation-item dropdown-item" data-selected-links="repo_pulls checks /ruby/ruby/pulls" href="/web/20230614175204/https://github.com/ruby/ruby/pulls"> Pull requests </a> </li> <li data-menu-item="i2actions-tab" hidden> <a role="menuitem" class="js-selected-navigation-item dropdown-item" data-selected-links="repo_actions /ruby/ruby/actions" href="/web/20230614175204/https://github.com/ruby/ruby/actions"> Actions </a> </li> <li data-menu-item="i3wiki-tab" hidden> <a role="menuitem" class="js-selected-navigation-item dropdown-item" data-selected-links="repo_wiki /ruby/ruby/wiki" href="/web/20230614175204/https://github.com/ruby/ruby/wiki"> Wiki </a> </li> <li data-menu-item="i4security-tab" hidden> <a role="menuitem" class="js-selected-navigation-item dropdown-item" data-selected-links="security overview alerts policy token_scanning code_scanning /ruby/ruby/security" href="/web/20230614175204/https://github.com/ruby/ruby/security"> Security </a> </li> <li data-menu-item="i5insights-tab" hidden> <a role="menuitem" class="js-selected-navigation-item dropdown-item" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /ruby/ruby/pulse" href="/web/20230614175204/https://github.com/ruby/ruby/pulse"> Insights </a> </li> </ul> </details-menu> </details></div> </nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content "> <div class="clearfix container-xl px-3 px-md-4 px-lg-5 mt-4"> <div> <a class="d-none js-permalink-shortcut" data-hotkey="y" href="/web/20230614175204/https://github.com/ruby/ruby/blob/813a5f4fc46a24ca1695d23c159250b9e1080ac7/dir.c">Permalink</a> <div class="d-flex flex-items-start flex-shrink-0 pb-3 flex-wrap flex-md-nowrap flex-justify-between flex-md-justify-start"> <div class="position-relative"> <details class="js-branch-select-menu details-reset details-overlay mr-0 mb-0 " id="branch-select-menu" data-hydro-click-payload="{"event_type":"repository.click","payload":{"target":"REFS_SELECTOR_MENU","repository_id":538746,"originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="b76a7baa8473143e55be92d5ff44b83cc42e341cb3429f92a49205dce6d1020c"> <summary class="btn css-truncate" data-hotkey="w" title="Switch branches or tags"> <svg text="gray" aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path> </svg> <span class="css-truncate-target" data-menu-button>master</span> <span class="dropdown-caret"></span> </summary> <div class="SelectMenu"> <div class="SelectMenu-modal"> <header class="SelectMenu-header"> <span class="SelectMenu-title">Switch branches/tags</span> <button class="SelectMenu-closeButton" type="button" data-toggle-for="branch-select-menu"><svg aria-label="Close menu" aria-hidden="false" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </header> <input-demux data-action="tab-container-change:input-demux#storeInput tab-container-changed:input-demux#updateInput"> <tab-container class="d-flex flex-column js-branches-tags-tabs" style="min-height: 0;"> <div class="SelectMenu-filter"> <input data-target="input-demux.source" id="context-commitish-filter-field" class="SelectMenu-input form-control" aria-owns="ref-list-branches" data-controls-ref-menu-id="ref-list-branches" autofocus autocomplete="off" aria-label="Filter branches/tags" placeholder="Filter branches/tags" type="text"> </div> <div class="SelectMenu-tabs" role="tablist" data-target="input-demux.control"> <button class="SelectMenu-tab" type="button" role="tab" aria-selected="true">Branches</button> <button class="SelectMenu-tab" type="button" role="tab">Tags</button> </div> <div role="tabpanel" id="ref-list-branches" data-filter-placeholder="Filter branches/tags" tabindex="" class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="branch" data-targets="input-demux.sinks" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " query-endpoint="/ruby/ruby/refs" cache-key="v0:1686553639.759905" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="cnVieS9ydWJ5" prefetch-on-mouseover> <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load branches</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message">Nothing to show</div> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list " data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewbox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke"/> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke"/> </svg> </div> </div> <template data-target="ref-selector.itemTemplate"> <a href="https://web.archive.org/web/20230614175204/https://github.com/ruby/ruby/blob/{{ urlEncodedRefName }}/dir.c" class="SelectMenu-item" role="menuitemradio" rel="nofollow" aria-checked="{{ isCurrent }}" data-index="{{ index }}"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> <span class="flex-1 css-truncate css-truncate-overflow {{ isFilteringClass }}">{{ refName }}</span> <span hidden="{{ isNotDefault }}" class="Label Label--secondary flex-self-start">default</span> </a> </template> <footer class="SelectMenu-footer"><a href="/web/20230614175204/https://github.com/ruby/ruby/branches">View all branches</a></footer> </ref-selector> </div> <div role="tabpanel" id="tags-menu" data-filter-placeholder="Find a tag" tabindex="" hidden class="d-flex flex-column flex-auto overflow-auto"> <ref-selector type="tag" data-action=" input-entered:ref-selector#inputEntered tab-selected:ref-selector#tabSelected focus-list:ref-selector#focusFirstListMember " data-targets="input-demux.sinks" query-endpoint="/ruby/ruby/refs" cache-key="v0:1686553639.759905" current-committish="bWFzdGVy" default-branch="bWFzdGVy" name-with-owner="cnVieS9ydWJ5"> <template data-target="ref-selector.fetchFailedTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Could not load tags</div> </template> <template data-target="ref-selector.noMatchTemplate"> <div class="SelectMenu-message" data-index="{{ index }}">Nothing to show</div> </template> <template data-target="ref-selector.itemTemplate"> <a href="https://web.archive.org/web/20230614175204/https://github.com/ruby/ruby/blob/{{ urlEncodedRefName }}/dir.c" class="SelectMenu-item" role="menuitemradio" rel="nofollow" aria-checked="{{ isCurrent }}" data-index="{{ index }}"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check SelectMenu-icon SelectMenu-icon--check"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> <span class="flex-1 css-truncate css-truncate-overflow {{ isFilteringClass }}">{{ refName }}</span> <span hidden="{{ isNotDefault }}" class="Label Label--secondary flex-self-start">default</span> </a> </template> <div data-target="ref-selector.listContainer" role="menu" class="SelectMenu-list" data-turbo-frame="repo-content-turbo-frame"> <div class="SelectMenu-loading pt-3 pb-0 overflow-hidden" aria-label="Menu is loading"> <svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewbox="0 0 16 16" fill="none" data-view-component="true" class="anim-rotate"> <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke"/> <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke"/> </svg> </div> </div> <footer class="SelectMenu-footer"><a href="/web/20230614175204/https://github.com/ruby/ruby/tags">View all tags</a></footer> </ref-selector> </div> </tab-container> </input-demux> </div> </div> </details> </div> <div class="Overlay--hidden Overlay-backdrop--center" data-modal-dialog-overlay> <modal-dialog role="dialog" id="warn-tag-match-create-branch-dialog" aria-modal="true" aria-labelledby="warn-tag-match-create-branch-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto Overlay--motion-scaleFade"> <header class="Overlay-header Overlay-header--large Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="warn-tag-match-create-branch-dialog-header" class="Overlay-title">Name already in use</h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </header> <div class="Overlay-body "> <div data-view-component="true"> A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? </div> </div> <footer class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn"> Cancel </button> <button data-submit-dialog-id="warn-tag-match-create-branch-dialog" type="button" data-view-component="true" class="btn-danger btn"> Create </button> </footer> </modal-dialog></div> <h2 id="blob-path" class="breadcrumb flex-auto flex-self-center min-width-0 text-normal mx-2 width-full width-md-auto flex-order-1 flex-md-order-none mt-3 mt-md-0"> <span class="js-repo-root text-bold"><span class="js-path-segment d-inline-block wb-break-all"><a data-turbo-frame="repo-content-turbo-frame" href="/web/20230614175204/https://github.com/ruby/ruby"><span>ruby</span></a></span></span><span class="separator">/</span><strong class="final-path">dir.c</strong> </h2> <a href="/web/20230614175204/https://github.com/ruby/ruby/find/master" data-pjax="" data-hotkey="t" data-view-component="true" class="btn mr-2 d-none d-md-block"> Go to file </a> <details id="blob-more-options-details" data-view-component="true" class="details-overlay details-reset position-relative"> <summary role="button" data-view-component="true" class="btn"> <svg aria-label="More options" role="img" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </summary> <div data-view-component="true"> <ul class="dropdown-menu dropdown-menu-sw"> <li class="d-block d-md-none"> <a class="dropdown-item d-flex flex-items-baseline" data-hydro-click="{"event_type":"repository.click","payload":{"target":"FIND_FILE_BUTTON","repository_id":538746,"originating_url":"https://github.com/ruby/ruby/blob/master/dir.c","user_id":null}}" data-hydro-click-hmac="754ba9955992eccc17429baf8b0f9431a607c89df0752c8fe01241c0a2e46a03" data-ga-click="Repository, find file, location:repo overview" data-hotkey="t" href="/web/20230614175204/https://github.com/ruby/ruby/find/master"> <span class="flex-auto">Go to file</span> <span class="text-small color-fg-muted" aria-hidden="true">T</span> </a> </li> <li data-toggle-for="blob-more-options-details"> <button data-toggle-for="jumpto-line-details-dialog" type="button" data-view-component="true" class="dropdown-item btn-link"> <span class="d-flex flex-items-baseline"> <span class="flex-auto">Go to line</span> <span class="text-small color-fg-muted" aria-hidden="true">L</span> </span> </button> </li> <li class="dropdown-divider" role="none"></li> <li> <clipboard-copy data-toggle-for="blob-more-options-details" aria-label="Copy path" value="dir.c" data-view-component="true" class="dropdown-item cursor-pointer"> Copy path </clipboard-copy> </li> <li> <clipboard-copy data-toggle-for="blob-more-options-details" aria-label="Copy permalink" value="https://github.com/ruby/ruby/blob/813a5f4fc46a24ca1695d23c159250b9e1080ac7/dir.c" data-view-component="true" class="dropdown-item cursor-pointer"> <span class="d-flex flex-items-baseline"> <span class="flex-auto">Copy permalink</span> </span> </clipboard-copy> </li> </ul> </div> </details></div> <div id="spoof-warning" class="mt-0 pb-3" hidden aria-hidden> <div data-view-component="true" class="flash flash-warn mt-0 clearfix"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert float-left mt-1"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <div class="overflow-hidden">This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.</div> </div></div> <include-fragment src="/ruby/ruby/spoofed_commit_check/813a5f4fc46a24ca1695d23c159250b9e1080ac7" data-test-selector="spoofed-commit-check"></include-fragment> <div class="Box d-flex flex-column flex-shrink-0 mb-3"> <include-fragment src="/ruby/ruby/contributors/master/dir.c" class="commit-loader"> <div class="Box-header d-flex flex-items-center"> <div class="Skeleton avatar avatar-user flex-shrink-0 ml-n1 mr-n1 mt-n1 mb-n1" style="width:24px;height:24px;"></div> <div class="Skeleton Skeleton--text col-5 ml-2"> </div> </div> <div class="Box-body d-flex flex-items-center"> <div class="Skeleton Skeleton--text col-1"> </div> <span class="color-fg-danger h6 loader-error">Cannot retrieve contributors at this time</span> </div> </include-fragment></div> <div data-target="readme-toc.content" class="Box mt-3 position-relative"> <div class="Box-header js-blob-header py-2 pr-2 d-flex flex-shrink-0 flex-md-row flex-items-center"> <div class="text-mono f6 flex-auto pr-3 flex-order-2 flex-md-order-1"> 3633 lines (3254 sloc) <span class="file-info-divider"></span> 93.3 KB </div> <div class="d-flex py-1 py-md-0 flex-auto flex-order-1 flex-md-order-2 flex-sm-grow-0 flex-justify-between hide-sm hide-md"> <div class="BtnGroup"> <a data-permalink-href="/ruby/ruby/raw/813a5f4fc46a24ca1695d23c159250b9e1080ac7/dir.c" href="/web/20230614175204/https://github.com/ruby/ruby/raw/master/dir.c" id="raw-url" group_item="true" data-view-component="true" class="js-permalink-replaceable-link Button--secondary Button--small Button"> <span class="Button-content"> <span class="Button-label">Raw</span> </span> </a> <a data-permalink-href="/ruby/ruby/blame/813a5f4fc46a24ca1695d23c159250b9e1080ac7/dir.c" href="/web/20230614175204/https://github.com/ruby/ruby/blame/master/dir.c" group_item="true" data-hotkey="b" data-view-component="true" class="js-update-url-with-hash js-permalink-replaceable-link Button--secondary Button--small Button"> <span class="Button-content"> <span class="Button-label">Blame</span> </span> </a> </div> <div class="d-flex"> <div class="ml-1"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="BtnGroup-parent js-update-url-with-hash " data-turbo="false" action="/web/20230614175204/https://github.com/ruby/ruby/edit/master/dir.c" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="El1mTeHGgaU1fnhMxVJ89X8nyAapePdx6V0Vl6iICgJTzv0KjO_gm1YY9gh7-9W4qxGHsu59lMsJgUsRr7paLw" autocomplete="off"/> <button disabled="disabled" title="You must be signed in to make or propose changes" data-hotkey="e" data-disable-with="" type="submit" data-view-component="true" class="btn-sm BtnGroup-item btn"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pencil"> <path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path> </svg> </button></form> <details class="details-reset details-overlay select-menu BtnGroup-parent d-inline-block position-relative"> <summary data-disable-invalid="" data-disable-with="" data-dropdown-tracking="{"type":"blob_edit_dropdown.more_options_click","context":{"repository_id":538746,"actor_id":null,"github_dev_enabled":false,"edit_enabled":false,"small_screen":false}}" aria-label="Select additional options" data-view-component="true" class="js-blob-dropdown-click select-menu-button btn-sm btn BtnGroup-item float-none px-2"> </summary> <div class="SelectMenu right-0"> <div class="SelectMenu-modal width-full"> <div class="SelectMenu-list SelectMenu-list--borderless py-2"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="SelectMenu-item js-update-url-with-hash " data-turbo="false" action="/web/20230614175204/https://github.com/ruby/ruby/edit/master/dir.c" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="KLFql9jsm7g9UR9BsoaU7EkJwM6OY_ce3lloh1vfQIhpIvHQtcX6hl43kQUMLz2hnT-PeslmlKQ-hTYBXO0QpQ" autocomplete="off"/> <button disabled="disabled" title="You must be signed in to make or propose changes" type="submit" data-view-component="true" class="btn-invisible btn width-full d-flex flex-justify-between color-fg-muted text-normal p-0"> <div class="mr-5">Edit this file</div> <div class="color-fg-muted">E</div> </button></form> <a data-platforms="windows,mac" aria-label="Open this file in GitHub Desktop" href="https://web.archive.org/web/20230614175204/https://desktop.github.com/" data-view-component="true" class="SelectMenu-item no-wrap js-remove-unless-platform width-full text-normal color-fg-default f5"> Open in GitHub Desktop </a> </div> </div> </div> </details> </div> <div> </div> <button class="btn-octicon btn-octicon-danger disabled tooltipped tooltipped-nw" disabled aria-label="You must be signed in to make or propose changes" type="button"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-trash"> <path d="M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"></path> </svg> </button> </div> </div> <div class="d-flex hide-lg hide-xl flex-order-2 flex-grow-0"> <details class="dropdown details-reset details-overlay d-inline-block"> <summary class="js-blob-dropdown-click btn-octicon" aria-haspopup="true" aria-label="Possible actions" data-dropdown-tracking="{"type":"blob_edit_dropdown.more_options_click","context":{"repository_id":538746,"actor_id":null,"github_dev_enabled":false,"edit_enabled":false,"small_screen":true}}"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </summary> <ul class="dropdown-menu dropdown-menu-sw" style="width: 175px"> <li> <a class="dropdown-item tooltipped tooltipped-nw js-remove-unless-platform" data-platforms="windows,mac" href="https://web.archive.org/web/20230614175204/https://desktop.github.com/"> Open with Desktop </a> </li> <li> <a class="dropdown-item" href="/web/20230614175204/https://github.com/ruby/ruby/raw/master/dir.c"> View raw </a> </li> <li> </li> <li> <a class="dropdown-item" href="/web/20230614175204/https://github.com/ruby/ruby/blame/master/dir.c"> View blame </a> </li> </ul> </details> </div> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper data type-c gist-border-0"> <div class="js-check-bidi js-blob-code-container blob-code-content"> <template class="js-file-alert-template"> <div data-view-component="true" class="flash flash-warn flash-full d-flex flex-items-center"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span> This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. <a href="https://web.archive.org/web/20230614175204/https://github.co/hiddenchars" target="_blank">Learn more about bidirectional Unicode characters</a> </span> <div data-view-component="true" class="flash-action"> <a href="{{ revealButtonHref }}" data-view-component="true" class="btn-sm btn"> Show hidden characters </a> </div> </div></template> <template class="js-line-alert-template"> <span aria-label="This line has hidden Unicode characters" data-view-component="true" class="line-alert tooltipped tooltipped-e"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span></template> <table data-hpc class="highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file" data-tab-size="8" data-paste-markdown-skip data-tagsearch-lang="C" data-tagsearch-path="dir.c"> <tr> <td id="L1" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1"></td> <td id="LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span>*********************************************************************</span></td> </tr> <tr> <td id="L2" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2"></td> <td id="LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td> </tr> <tr> <td id="L3" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3"></td> <td id="LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> dir.c -</span></td> </tr> <tr> <td id="L4" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="4"></td> <td id="LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td> </tr> <tr> <td id="L5" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="5"></td> <td id="LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> $Author$</span></td> </tr> <tr> <td id="L6" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="6"></td> <td id="LC6" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> created at: Wed Jan 5 09:51:01 JST 1994</span></td> </tr> <tr> <td id="L7" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="7"></td> <td id="LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td> </tr> <tr> <td id="L8" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="8"></td> <td id="LC8" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Copyright (C) 1993-2007 Yukihiro Matsumoto</span></td> </tr> <tr> <td id="L9" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="9"></td> <td id="LC9" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Copyright (C) 2000 Network Applied Communication Laboratory, Inc.</span></td> </tr> <tr> <td id="L10" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="10"></td> <td id="LC10" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Copyright (C) 2000 Information-technology Promotion Agency, Japan</span></td> </tr> <tr> <td id="L11" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="11"></td> <td id="LC11" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td> </tr> <tr> <td id="L12" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="12"></td> <td id="LC12" class="blob-code blob-code-inner js-file-line"><span class="pl-c">*********************************************************************<span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L13" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="13"></td> <td id="LC13" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L14" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="14"></td> <td id="LC14" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>ruby/internal/config.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L15" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="15"></td> <td id="LC15" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L16" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="16"></td> <td id="LC16" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>ctype.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L17" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="17"></td> <td id="LC17" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>errno.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L18" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="18"></td> <td id="LC18" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/types.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L19" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="19"></td> <td id="LC19" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/stat.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L20" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="20"></td> <td id="LC20" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L21" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="21"></td> <td id="LC21" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_UNISTD_H</td> </tr> <tr> <td id="L22" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="22"></td> <td id="LC22" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>unistd.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L23" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="23"></td> <td id="LC23" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L24" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="24"></td> <td id="LC24" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L25" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="25"></td> <td id="LC25" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> O_CLOEXEC</td> </tr> <tr> <td id="L26" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="26"></td> <td id="LC26" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">O_CLOEXEC</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L27" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="27"></td> <td id="LC27" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L28" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="28"></td> <td id="LC28" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L29" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="29"></td> <td id="LC29" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> USE_OPENDIR_AT</td> </tr> <tr> <td id="L30" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="30"></td> <td id="LC30" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD) && \</td> </tr> <tr> <td id="L31" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="31"></td> <td id="LC31" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">defined</span>(HAVE_OPENAT) && defined(HAVE_FSTATAT)</td> </tr> <tr> <td id="L32" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="32"></td> <td id="LC32" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">USE_OPENDIR_AT</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L33" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="33"></td> <td id="LC33" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">else</span></td> </tr> <tr> <td id="L34" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="34"></td> <td id="LC34" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">USE_OPENDIR_AT</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L35" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="35"></td> <td id="LC35" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L36" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="36"></td> <td id="LC36" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L37" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="37"></td> <td id="LC37" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L38" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="38"></td> <td id="LC38" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_OPENDIR_AT</td> </tr> <tr> <td id="L39" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="39"></td> <td id="LC39" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>fcntl.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L40" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="40"></td> <td id="LC40" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L41" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="41"></td> <td id="LC41" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L42" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="42"></td> <td id="LC42" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">undef</span> HAVE_DIRENT_NAMLEN</td> </tr> <tr> <td id="L43" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="43"></td> <td id="LC43" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined HAVE_DIRENT_H && !defined _WIN32</td> </tr> <tr> <td id="L44" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="44"></td> <td id="LC44" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>dirent.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L45" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="45"></td> <td id="LC45" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">NAMLEN</span>(<span class="pl-v">dirent</span>) strlen((dirent)->d_name)</td> </tr> <tr> <td id="L46" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="46"></td> <td id="LC46" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">elif</span> defined HAVE_DIRECT_H && !defined _WIN32</td> </tr> <tr> <td id="L47" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="47"></td> <td id="LC47" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>direct.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L48" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="48"></td> <td id="LC48" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">NAMLEN</span>(<span class="pl-v">dirent</span>) strlen((dirent)->d_name)</td> </tr> <tr> <td id="L49" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="49"></td> <td id="LC49" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L50" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="50"></td> <td id="LC50" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">dirent</span> direct</td> </tr> <tr> <td id="L51" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="51"></td> <td id="LC51" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">NAMLEN</span>(<span class="pl-v">dirent</span>) (dirent)->d_namlen</td> </tr> <tr> <td id="L52" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="52"></td> <td id="LC52" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">HAVE_DIRENT_NAMLEN</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L53" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="53"></td> <td id="LC53" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">ifdef</span> HAVE_SYS_NDIR_H</td> </tr> <tr> <td id="L54" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="54"></td> <td id="LC54" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/ndir.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L55" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="55"></td> <td id="LC55" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L56" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="56"></td> <td id="LC56" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">ifdef</span> HAVE_SYS_DIR_H</td> </tr> <tr> <td id="L57" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="57"></td> <td id="LC57" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/dir.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L58" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="58"></td> <td id="LC58" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L59" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="59"></td> <td id="LC59" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">ifdef</span> HAVE_NDIR_H</td> </tr> <tr> <td id="L60" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="60"></td> <td id="LC60" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>ndir.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L61" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="61"></td> <td id="LC61" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L62" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="62"></td> <td id="LC62" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L63" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="63"></td> <td id="LC63" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>win32/dir.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L64" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="64"></td> <td id="LC64" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L65" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="65"></td> <td id="LC65" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L66" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="66"></td> <td id="LC66" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L67" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="67"></td> <td id="LC67" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> HAVE_STDLIB_H</td> </tr> <tr> <td id="L68" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="68"></td> <td id="LC68" class="blob-code blob-code-inner js-file-line"><span class="pl-k">char</span> *<span class="pl-en">getenv</span>();</td> </tr> <tr> <td id="L69" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="69"></td> <td id="LC69" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L70" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="70"></td> <td id="LC70" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L71" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="71"></td> <td id="LC71" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> HAVE_STRING_H</td> </tr> <tr> <td id="L72" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="72"></td> <td id="LC72" class="blob-code blob-code-inner js-file-line"><span class="pl-k">char</span> *<span class="pl-en">strchr</span>(<span class="pl-k">char</span>*,<span class="pl-k">char</span>);</td> </tr> <tr> <td id="L73" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="73"></td> <td id="LC73" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L74" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="74"></td> <td id="LC74" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L75" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="75"></td> <td id="LC75" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_SYS_ATTR_H</td> </tr> <tr> <td id="L76" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="76"></td> <td id="LC76" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/attr.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L77" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="77"></td> <td id="LC77" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L78" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="78"></td> <td id="LC78" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L79" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="79"></td> <td id="LC79" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">USE_NAME_ON_FS_REAL_BASENAME</span> <span class="pl-c1">1</span> <span class="pl-c"><span class="pl-c">/*</span> platform dependent APIs to</span></td> </tr> <tr> <td id="L80" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="80"></td> <td id="LC80" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * get real basenames <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L81" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="81"></td> <td id="LC81" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">USE_NAME_ON_FS_BY_FNMATCH</span> <span class="pl-c1">2</span> <span class="pl-c"><span class="pl-c">/*</span> select the matching</span></td> </tr> <tr> <td id="L82" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="82"></td> <td id="LC82" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * basename by fnmatch <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L83" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="83"></td> <td id="LC83" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L84" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="84"></td> <td id="LC84" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_GETATTRLIST</td> </tr> <tr> <td id="L85" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="85"></td> <td id="LC85" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">USE_NAME_ON_FS</span> USE_NAME_ON_FS_REAL_BASENAME</td> </tr> <tr> <td id="L86" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="86"></td> <td id="LC86" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">RUP32</span>(<span class="pl-v">size</span>) ((size)+<span class="pl-c1">3</span>/<span class="pl-c1">4</span>)</td> </tr> <tr> <td id="L87" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="87"></td> <td id="LC87" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">SIZEUP32</span>(<span class="pl-v">type</span>) RUP32(<span class="pl-k">sizeof</span>(type))</td> </tr> <tr> <td id="L88" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="88"></td> <td id="LC88" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">elif</span> defined _WIN32</td> </tr> <tr> <td id="L89" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="89"></td> <td id="LC89" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">USE_NAME_ON_FS</span> USE_NAME_ON_FS_REAL_BASENAME</td> </tr> <tr> <td id="L90" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="90"></td> <td id="LC90" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">elif</span> defined DOSISH</td> </tr> <tr> <td id="L91" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="91"></td> <td id="LC91" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">USE_NAME_ON_FS</span> USE_NAME_ON_FS_BY_FNMATCH</td> </tr> <tr> <td id="L92" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="92"></td> <td id="LC92" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L93" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="93"></td> <td id="LC93" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">USE_NAME_ON_FS</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L94" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="94"></td> <td id="LC94" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L95" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="95"></td> <td id="LC95" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L96" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="96"></td> <td id="LC96" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> __APPLE__</td> </tr> <tr> <td id="L97" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="97"></td> <td id="LC97" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">NORMALIZE_UTF8PATH</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L98" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="98"></td> <td id="LC98" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/param.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L99" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="99"></td> <td id="LC99" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/mount.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L100" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="100"></td> <td id="LC100" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds"><</span>sys/vnode.h<span class="pl-pds">></span></span></td> </tr> <tr> <td id="L101" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="101"></td> <td id="LC101" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L102" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="102"></td> <td id="LC102" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">NORMALIZE_UTF8PATH</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L103" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="103"></td> <td id="LC103" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L104" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="104"></td> <td id="LC104" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L105" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="105"></td> <td id="LC105" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>encindex.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L106" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="106"></td> <td id="LC106" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>id.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L107" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="107"></td> <td id="LC107" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L108" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="108"></td> <td id="LC108" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/array.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L109" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="109"></td> <td id="LC109" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/dir.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L110" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="110"></td> <td id="LC110" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/encoding.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L111" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="111"></td> <td id="LC111" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/error.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L112" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="112"></td> <td id="LC112" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/file.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L113" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="113"></td> <td id="LC113" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/gc.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L114" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="114"></td> <td id="LC114" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/io.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L115" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="115"></td> <td id="LC115" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/object.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L116" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="116"></td> <td id="LC116" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>internal/vm.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L117" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="117"></td> <td id="LC117" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>ruby/encoding.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L118" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="118"></td> <td id="LC118" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>ruby/ruby.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L119" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="119"></td> <td id="LC119" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>ruby/thread.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L120" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="120"></td> <td id="LC120" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>ruby/util.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L121" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="121"></td> <td id="LC121" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>builtin.h<span class="pl-pds">"</span></span></td> </tr> <tr> <td id="L122" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="122"></td> <td id="LC122" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L123" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="123"></td> <td id="LC123" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> AT_FDCWD</td> </tr> <tr> <td id="L124" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="124"></td> <td id="LC124" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">AT_FDCWD</span> -<span class="pl-c1">1</span></td> </tr> <tr> <td id="L125" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="125"></td> <td id="LC125" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L126" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="126"></td> <td id="LC126" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L127" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="127"></td> <td id="LC127" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">vm_initialized</span> rb_cThread</td> </tr> <tr> <td id="L128" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="128"></td> <td id="LC128" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L129" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="129"></td> <td id="LC129" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> define system APIs <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L130" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="130"></td> <td id="LC130" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L131" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="131"></td> <td id="LC131" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">undef</span> chdir</td> </tr> <tr> <td id="L132" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="132"></td> <td id="LC132" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">chdir</span>(<span class="pl-v">p</span>) rb_w32_uchdir(p)</td> </tr> <tr> <td id="L133" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="133"></td> <td id="LC133" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">undef</span> mkdir</td> </tr> <tr> <td id="L134" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="134"></td> <td id="LC134" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">mkdir</span>(<span class="pl-v">p, m</span>) rb_w32_umkdir((p), (m))</td> </tr> <tr> <td id="L135" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="135"></td> <td id="LC135" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">undef</span> rmdir</td> </tr> <tr> <td id="L136" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="136"></td> <td id="LC136" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">rmdir</span>(<span class="pl-v">p</span>) rb_w32_urmdir(p)</td> </tr> <tr> <td id="L137" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="137"></td> <td id="LC137" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">undef</span> opendir</td> </tr> <tr> <td id="L138" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="138"></td> <td id="LC138" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">opendir</span>(<span class="pl-v">p</span>) rb_w32_uopendir(p)</td> </tr> <tr> <td id="L139" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="139"></td> <td id="LC139" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">ruby_getcwd</span>() rb_w32_ugetcwd(<span class="pl-c1">NULL</span>, <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L140" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="140"></td> <td id="LC140" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">IS_WIN32</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L141" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="141"></td> <td id="LC141" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L142" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="142"></td> <td id="LC142" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">IS_WIN32</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L143" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="143"></td> <td id="LC143" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L144" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="144"></td> <td id="LC144" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L145" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="145"></td> <td id="LC145" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> NORMALIZE_UTF8PATH</td> </tr> <tr> <td id="L146" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="146"></td> <td id="LC146" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined HAVE_FGETATTRLIST || !defined HAVE_GETATTRLIST</td> </tr> <tr> <td id="L147" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="147"></td> <td id="LC147" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">need_normalization</span>(<span class="pl-v">dirp, path</span>) need_normalization(dirp)</td> </tr> <tr> <td id="L148" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="148"></td> <td id="LC148" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">else</span></td> </tr> <tr> <td id="L149" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="149"></td> <td id="LC149" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">need_normalization</span>(<span class="pl-v">dirp, path</span>) need_normalization(path)</td> </tr> <tr> <td id="L150" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="150"></td> <td id="LC150" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L151" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="151"></td> <td id="LC151" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">inline</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L152" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="152"></td> <td id="LC152" class="blob-code blob-code-inner js-file-line"><span class="pl-en">need_normalization</span>(DIR *dirp, <span class="pl-k">const</span> <span class="pl-k">char</span> *path)</td> </tr> <tr> <td id="L153" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="153"></td> <td id="LC153" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L154" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="154"></td> <td id="LC154" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined HAVE_FGETATTRLIST || defined HAVE_GETATTRLIST</td> </tr> <tr> <td id="L155" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="155"></td> <td id="LC155" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">u_int32_t</span> attrbuf[<span class="pl-c1">SIZEUP32</span>(<span class="pl-c1">fsobj_tag_t</span>)];</td> </tr> <tr> <td id="L156" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="156"></td> <td id="LC156" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> attrlist al = {ATTR_BIT_MAP_COUNT, <span class="pl-c1">0</span>, ATTR_CMN_OBJTAG,};</td> </tr> <tr> <td id="L157" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="157"></td> <td id="LC157" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined HAVE_FGETATTRLIST</td> </tr> <tr> <td id="L158" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="158"></td> <td id="LC158" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ret = <span class="pl-c1">fgetattrlist</span>(<span class="pl-c1">dirfd</span>(dirp), &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L159" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="159"></td> <td id="LC159" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">else</span></td> </tr> <tr> <td id="L160" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="160"></td> <td id="LC160" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ret = <span class="pl-c1">getattrlist</span>(path, &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L161" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="161"></td> <td id="LC161" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L162" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="162"></td> <td id="LC162" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!ret) {</td> </tr> <tr> <td id="L163" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="163"></td> <td id="LC163" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">fsobj_tag_t</span> *tag = (<span class="pl-k">void</span> *)(attrbuf+<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L164" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="164"></td> <td id="LC164" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (*tag) {</td> </tr> <tr> <td id="L165" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="165"></td> <td id="LC165" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> VT_HFS:</td> </tr> <tr> <td id="L166" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="166"></td> <td id="LC166" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> VT_CIFS:</td> </tr> <tr> <td id="L167" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="167"></td> <td id="LC167" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L168" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="168"></td> <td id="LC168" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L169" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="169"></td> <td id="LC169" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L170" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="170"></td> <td id="LC170" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L171" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="171"></td> <td id="LC171" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L172" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="172"></td> <td id="LC172" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L173" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="173"></td> <td id="LC173" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L174" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="174"></td> <td id="LC174" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">inline</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L175" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="175"></td> <td id="LC175" class="blob-code blob-code-inner js-file-line"><span class="pl-en">has_nonascii</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *ptr, <span class="pl-c1">size_t</span> len)</td> </tr> <tr> <td id="L176" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="176"></td> <td id="LC176" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L177" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="177"></td> <td id="LC177" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (len > <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L178" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="178"></td> <td id="LC178" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">ISASCII</span>(*ptr)) <span class="pl-k">return</span> <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L179" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="179"></td> <td id="LC179" class="blob-code blob-code-inner js-file-line"> ptr++;</td> </tr> <tr> <td id="L180" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="180"></td> <td id="LC180" class="blob-code blob-code-inner js-file-line"> --len;</td> </tr> <tr> <td id="L181" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="181"></td> <td id="LC181" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L182" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="182"></td> <td id="LC182" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L183" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="183"></td> <td id="LC183" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L184" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="184"></td> <td id="LC184" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L185" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="185"></td> <td id="LC185" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">IF_NORMALIZE_UTF8PATH</span>(<span class="pl-v">something</span>) something</td> </tr> <tr> <td id="L186" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="186"></td> <td id="LC186" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L187" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="187"></td> <td id="LC187" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">IF_NORMALIZE_UTF8PATH</span>(<span class="pl-v">something</span>) <span class="pl-c"><span class="pl-c">/*</span> nothing <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L188" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="188"></td> <td id="LC188" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L189" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="189"></td> <td id="LC189" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L190" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="190"></td> <td id="LC190" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined(IFTODT) && defined(DT_UNKNOWN)</td> </tr> <tr> <td id="L191" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="191"></td> <td id="LC191" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">EMULATE_IFTODT</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L192" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="192"></td> <td id="LC192" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L193" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="193"></td> <td id="LC193" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">EMULATE_IFTODT</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L194" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="194"></td> <td id="LC194" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L195" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="195"></td> <td id="LC195" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L196" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="196"></td> <td id="LC196" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> EMULATE_IFTODT</td> </tr> <tr> <td id="L197" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="197"></td> <td id="LC197" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">IFTODT</span>(<span class="pl-v">m</span>) (((m) & S_IFMT) / ((~S_IFMT & (S_IFMT-<span class="pl-c1">1</span>)) + <span class="pl-c1">1</span>))</td> </tr> <tr> <td id="L198" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="198"></td> <td id="LC198" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L199" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="199"></td> <td id="LC199" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L200" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="200"></td> <td id="LC200" class="blob-code blob-code-inner js-file-line"><span class="pl-k">typedef</span> <span class="pl-k">enum</span> {</td> </tr> <tr> <td id="L201" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="201"></td> <td id="LC201" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> !EMULATE_IFTODT</td> </tr> <tr> <td id="L202" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="202"></td> <td id="LC202" class="blob-code blob-code-inner js-file-line"> path_exist = DT_UNKNOWN,</td> </tr> <tr> <td id="L203" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="203"></td> <td id="LC203" class="blob-code blob-code-inner js-file-line"> path_directory = DT_DIR,</td> </tr> <tr> <td id="L204" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="204"></td> <td id="LC204" class="blob-code blob-code-inner js-file-line"> path_regular = DT_REG,</td> </tr> <tr> <td id="L205" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="205"></td> <td id="LC205" class="blob-code blob-code-inner js-file-line"> path_symlink = DT_LNK,</td> </tr> <tr> <td id="L206" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="206"></td> <td id="LC206" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L207" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="207"></td> <td id="LC207" class="blob-code blob-code-inner js-file-line"> path_exist,</td> </tr> <tr> <td id="L208" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="208"></td> <td id="LC208" class="blob-code blob-code-inner js-file-line"> path_directory = <span class="pl-c1">IFTODT</span>(S_IFDIR),</td> </tr> <tr> <td id="L209" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="209"></td> <td id="LC209" class="blob-code blob-code-inner js-file-line"> path_regular = <span class="pl-c1">IFTODT</span>(S_IFREG),</td> </tr> <tr> <td id="L210" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="210"></td> <td id="LC210" class="blob-code blob-code-inner js-file-line"> path_symlink = <span class="pl-c1">IFTODT</span>(S_IFLNK),</td> </tr> <tr> <td id="L211" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="211"></td> <td id="LC211" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L212" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="212"></td> <td id="LC212" class="blob-code blob-code-inner js-file-line"> path_noent = -<span class="pl-c1">1</span>,</td> </tr> <tr> <td id="L213" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="213"></td> <td id="LC213" class="blob-code blob-code-inner js-file-line"> path_unknown = -<span class="pl-c1">2</span></td> </tr> <tr> <td id="L214" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="214"></td> <td id="LC214" class="blob-code blob-code-inner js-file-line">} <span class="pl-c1">rb_pathtype_t</span>;</td> </tr> <tr> <td id="L215" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="215"></td> <td id="LC215" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L216" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="216"></td> <td id="LC216" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_NOESCAPE</span> <span class="pl-c1">0x01</span></td> </tr> <tr> <td id="L217" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="217"></td> <td id="LC217" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_PATHNAME</span> <span class="pl-c1">0x02</span></td> </tr> <tr> <td id="L218" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="218"></td> <td id="LC218" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_DOTMATCH</span> <span class="pl-c1">0x04</span></td> </tr> <tr> <td id="L219" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="219"></td> <td id="LC219" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_CASEFOLD</span> <span class="pl-c1">0x08</span></td> </tr> <tr> <td id="L220" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="220"></td> <td id="LC220" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_EXTGLOB</span> <span class="pl-c1">0x10</span></td> </tr> <tr> <td id="L221" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="221"></td> <td id="LC221" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> CASEFOLD_FILESYSTEM</td> </tr> <tr> <td id="L222" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="222"></td> <td id="LC222" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_SYSCASE</span> FNM_CASEFOLD</td> </tr> <tr> <td id="L223" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="223"></td> <td id="LC223" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L224" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="224"></td> <td id="LC224" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_SYSCASE</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L225" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="225"></td> <td id="LC225" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L226" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="226"></td> <td id="LC226" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L227" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="227"></td> <td id="LC227" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_SHORTNAME</span> <span class="pl-c1">0x20</span></td> </tr> <tr> <td id="L228" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="228"></td> <td id="LC228" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L229" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="229"></td> <td id="LC229" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_SHORTNAME</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L230" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="230"></td> <td id="LC230" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L231" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="231"></td> <td id="LC231" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_GLOB_NOSORT</span> <span class="pl-c1">0x40</span></td> </tr> <tr> <td id="L232" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="232"></td> <td id="LC232" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_GLOB_SKIPDOT</span> <span class="pl-c1">0x80</span></td> </tr> <tr> <td id="L233" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="233"></td> <td id="LC233" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L234" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="234"></td> <td id="LC234" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_NOMATCH</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L235" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="235"></td> <td id="LC235" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">FNM_ERROR</span> <span class="pl-c1">2</span></td> </tr> <tr> <td id="L236" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="236"></td> <td id="LC236" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L237" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="237"></td> <td id="LC237" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">Next</span>(<span class="pl-v">p, e, enc</span>) ((p)+ rb_enc_mbclen((p), (e), (enc)))</td> </tr> <tr> <td id="L238" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="238"></td> <td id="LC238" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">Inc</span>(<span class="pl-v">p, e, enc</span>) ((p) = Next((p), (e), (enc)))</td> </tr> <tr> <td id="L239" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="239"></td> <td id="LC239" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L240" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="240"></td> <td id="LC240" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">char</span> *</td> </tr> <tr> <td id="L241" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="241"></td> <td id="LC241" class="blob-code blob-code-inner js-file-line"><span class="pl-en">bracket</span>(</td> </tr> <tr> <td id="L242" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="242"></td> <td id="LC242" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *p, <span class="pl-c"><span class="pl-c">/*</span> pattern (next to '[') <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L243" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="243"></td> <td id="LC243" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *pend,</td> </tr> <tr> <td id="L244" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="244"></td> <td id="LC244" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *s, <span class="pl-c"><span class="pl-c">/*</span> string <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L245" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="245"></td> <td id="LC245" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *send,</td> </tr> <tr> <td id="L246" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="246"></td> <td id="LC246" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags,</td> </tr> <tr> <td id="L247" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="247"></td> <td id="LC247" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc)</td> </tr> <tr> <td id="L248" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="248"></td> <td id="LC248" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L249" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="249"></td> <td id="LC249" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> nocase = flags & FNM_CASEFOLD;</td> </tr> <tr> <td id="L250" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="250"></td> <td id="LC250" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> escape = !(flags & FNM_NOESCAPE);</td> </tr> <tr> <td id="L251" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="251"></td> <td id="LC251" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">unsigned</span> <span class="pl-k">int</span> c1, c2;</td> </tr> <tr> <td id="L252" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="252"></td> <td id="LC252" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> r;</td> </tr> <tr> <td id="L253" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="253"></td> <td id="LC253" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ok = <span class="pl-c1">0</span>, not = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L254" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="254"></td> <td id="LC254" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L255" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="255"></td> <td id="LC255" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (p >= pend) <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L256" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="256"></td> <td id="LC256" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span>!<span class="pl-pds">'</span></span> || *p == <span class="pl-s"><span class="pl-pds">'</span>^<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L257" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="257"></td> <td id="LC257" class="blob-code blob-code-inner js-file-line"> not = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L258" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="258"></td> <td id="LC258" class="blob-code blob-code-inner js-file-line"> p++;</td> </tr> <tr> <td id="L259" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="259"></td> <td id="LC259" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L260" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="260"></td> <td id="LC260" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L261" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="261"></td> <td id="LC261" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (*p != <span class="pl-s"><span class="pl-pds">'</span>]<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L262" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="262"></td> <td id="LC262" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *t1 = p;</td> </tr> <tr> <td id="L263" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="263"></td> <td id="LC263" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (escape && *t1 == <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span>)</td> </tr> <tr> <td id="L264" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="264"></td> <td id="LC264" class="blob-code blob-code-inner js-file-line"> t1++;</td> </tr> <tr> <td id="L265" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="265"></td> <td id="LC265" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!*t1)</td> </tr> <tr> <td id="L266" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="266"></td> <td id="LC266" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L267" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="267"></td> <td id="LC267" class="blob-code blob-code-inner js-file-line"> p = t1 + (r = <span class="pl-c1">rb_enc_mbclen</span>(t1, pend, enc));</td> </tr> <tr> <td id="L268" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="268"></td> <td id="LC268" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (p >= pend) <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L269" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="269"></td> <td id="LC269" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (p[<span class="pl-c1">0</span>] == <span class="pl-s"><span class="pl-pds">'</span>-<span class="pl-pds">'</span></span> && p[<span class="pl-c1">1</span>] != <span class="pl-s"><span class="pl-pds">'</span>]<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L270" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="270"></td> <td id="LC270" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *t2 = p + <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L271" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="271"></td> <td id="LC271" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> r2;</td> </tr> <tr> <td id="L272" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="272"></td> <td id="LC272" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (escape && *t2 == <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span>)</td> </tr> <tr> <td id="L273" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="273"></td> <td id="LC273" class="blob-code blob-code-inner js-file-line"> t2++;</td> </tr> <tr> <td id="L274" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="274"></td> <td id="LC274" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!*t2)</td> </tr> <tr> <td id="L275" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="275"></td> <td id="LC275" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L276" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="276"></td> <td id="LC276" class="blob-code blob-code-inner js-file-line"> p = t2 + (r2 = <span class="pl-c1">rb_enc_mbclen</span>(t2, pend, enc));</td> </tr> <tr> <td id="L277" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="277"></td> <td id="LC277" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (ok) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L278" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="278"></td> <td id="LC278" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> ((r <= (send-s) && <span class="pl-c1">memcmp</span>(t1, s, r) == <span class="pl-c1">0</span>) ||</td> </tr> <tr> <td id="L279" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="279"></td> <td id="LC279" class="blob-code blob-code-inner js-file-line"> (r2 <= (send-s) && <span class="pl-c1">memcmp</span>(t2, s, r2) == <span class="pl-c1">0</span>)) {</td> </tr> <tr> <td id="L280" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="280"></td> <td id="LC280" class="blob-code blob-code-inner js-file-line"> ok = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L281" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="281"></td> <td id="LC281" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L282" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="282"></td> <td id="LC282" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L283" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="283"></td> <td id="LC283" class="blob-code blob-code-inner js-file-line"> c1 = <span class="pl-c1">rb_enc_codepoint</span>(s, send, enc);</td> </tr> <tr> <td id="L284" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="284"></td> <td id="LC284" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (nocase) c1 = <span class="pl-c1">rb_enc_toupper</span>(c1, enc);</td> </tr> <tr> <td id="L285" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="285"></td> <td id="LC285" class="blob-code blob-code-inner js-file-line"> c2 = <span class="pl-c1">rb_enc_codepoint</span>(t1, pend, enc);</td> </tr> <tr> <td id="L286" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="286"></td> <td id="LC286" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (nocase) c2 = <span class="pl-c1">rb_enc_toupper</span>(c2, enc);</td> </tr> <tr> <td id="L287" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="287"></td> <td id="LC287" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (c1 < c2) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L288" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="288"></td> <td id="LC288" class="blob-code blob-code-inner js-file-line"> c2 = <span class="pl-c1">rb_enc_codepoint</span>(t2, pend, enc);</td> </tr> <tr> <td id="L289" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="289"></td> <td id="LC289" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (nocase) c2 = <span class="pl-c1">rb_enc_toupper</span>(c2, enc);</td> </tr> <tr> <td id="L290" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="290"></td> <td id="LC290" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (c1 > c2) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L291" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="291"></td> <td id="LC291" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L292" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="292"></td> <td id="LC292" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L293" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="293"></td> <td id="LC293" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (ok) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L294" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="294"></td> <td id="LC294" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (r <= (send-s) && <span class="pl-c1">memcmp</span>(t1, s, r) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L295" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="295"></td> <td id="LC295" class="blob-code blob-code-inner js-file-line"> ok = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L296" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="296"></td> <td id="LC296" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L297" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="297"></td> <td id="LC297" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L298" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="298"></td> <td id="LC298" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!nocase) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L299" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="299"></td> <td id="LC299" class="blob-code blob-code-inner js-file-line"> c1 = <span class="pl-c1">rb_enc_toupper</span>(<span class="pl-c1">rb_enc_codepoint</span>(s, send, enc), enc);</td> </tr> <tr> <td id="L300" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="300"></td> <td id="LC300" class="blob-code blob-code-inner js-file-line"> c2 = <span class="pl-c1">rb_enc_toupper</span>(<span class="pl-c1">rb_enc_codepoint</span>(p, pend, enc), enc);</td> </tr> <tr> <td id="L301" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="301"></td> <td id="LC301" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (c1 != c2) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L302" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="302"></td> <td id="LC302" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L303" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="303"></td> <td id="LC303" class="blob-code blob-code-inner js-file-line"> ok = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L304" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="304"></td> <td id="LC304" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L305" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="305"></td> <td id="LC305" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L306" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="306"></td> <td id="LC306" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ok == not ? <span class="pl-c1">NULL</span> : (<span class="pl-k">char</span> *)p + <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L307" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="307"></td> <td id="LC307" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L308" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="308"></td> <td id="LC308" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L309" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="309"></td> <td id="LC309" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> If FNM_PATHNAME is set, only path element will be matched. (up to '/' or '\0')</span></td> </tr> <tr> <td id="L310" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="310"></td> <td id="LC310" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Otherwise, entire string will be matched.</span></td> </tr> <tr> <td id="L311" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="311"></td> <td id="LC311" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> End marker itself won't be compared.</span></td> </tr> <tr> <td id="L312" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="312"></td> <td id="LC312" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> And if function succeeds, *pcur reaches end marker.</span></td> </tr> <tr> <td id="L313" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="313"></td> <td id="LC313" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L314" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="314"></td> <td id="LC314" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">UNESCAPE</span>(<span class="pl-v">p</span>) (escape && *(p) == <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span> ? (p) + <span class="pl-c1">1</span> : (p))</td> </tr> <tr> <td id="L315" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="315"></td> <td id="LC315" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">ISEND</span>(<span class="pl-v">p</span>) (!*(p) || (pathname && *(p) == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>))</td> </tr> <tr> <td id="L316" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="316"></td> <td id="LC316" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">RETURN</span>(<span class="pl-v">val</span>) <span class="pl-k">return</span> *pcur = p, *scur = s, (val);</td> </tr> <tr> <td id="L317" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="317"></td> <td id="LC317" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L318" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="318"></td> <td id="LC318" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L319" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="319"></td> <td id="LC319" class="blob-code blob-code-inner js-file-line"><span class="pl-en">fnmatch_helper</span>(</td> </tr> <tr> <td id="L320" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="320"></td> <td id="LC320" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> **pcur, <span class="pl-c"><span class="pl-c">/*</span> pattern <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L321" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="321"></td> <td id="LC321" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> **scur, <span class="pl-c"><span class="pl-c">/*</span> string <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L322" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="322"></td> <td id="LC322" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags,</td> </tr> <tr> <td id="L323" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="323"></td> <td id="LC323" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc)</td> </tr> <tr> <td id="L324" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="324"></td> <td id="LC324" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L325" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="325"></td> <td id="LC325" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> period = !(flags & FNM_DOTMATCH);</td> </tr> <tr> <td id="L326" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="326"></td> <td id="LC326" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> pathname = flags & FNM_PATHNAME;</td> </tr> <tr> <td id="L327" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="327"></td> <td id="LC327" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> escape = !(flags & FNM_NOESCAPE);</td> </tr> <tr> <td id="L328" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="328"></td> <td id="LC328" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> nocase = flags & FNM_CASEFOLD;</td> </tr> <tr> <td id="L329" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="329"></td> <td id="LC329" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L330" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="330"></td> <td id="LC330" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *ptmp = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L331" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="331"></td> <td id="LC331" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *stmp = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L332" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="332"></td> <td id="LC332" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L333" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="333"></td> <td id="LC333" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *p = *pcur;</td> </tr> <tr> <td id="L334" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="334"></td> <td id="LC334" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *pend = p + <span class="pl-c1">strlen</span>(p);</td> </tr> <tr> <td id="L335" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="335"></td> <td id="LC335" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *s = *scur;</td> </tr> <tr> <td id="L336" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="336"></td> <td id="LC336" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *send = s + <span class="pl-c1">strlen</span>(s);</td> </tr> <tr> <td id="L337" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="337"></td> <td id="LC337" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L338" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="338"></td> <td id="LC338" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> r;</td> </tr> <tr> <td id="L339" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="339"></td> <td id="LC339" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L340" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="340"></td> <td id="LC340" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (period && *s == <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span> && *<span class="pl-c1">UNESCAPE</span>(p) != <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) <span class="pl-c"><span class="pl-c">/*</span> leading period <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L341" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="341"></td> <td id="LC341" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN</span>(FNM_NOMATCH);</td> </tr> <tr> <td id="L342" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="342"></td> <td id="LC342" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L343" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="343"></td> <td id="LC343" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (<span class="pl-c1">1</span>) {</td> </tr> <tr> <td id="L344" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="344"></td> <td id="LC344" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (*p) {</td> </tr> <tr> <td id="L345" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="345"></td> <td id="LC345" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L346" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="346"></td> <td id="LC346" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">do</span> { p++; } <span class="pl-k">while</span> (*p == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span>);</td> </tr> <tr> <td id="L347" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="347"></td> <td id="LC347" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ISEND</span>(<span class="pl-c1">UNESCAPE</span>(p))) {</td> </tr> <tr> <td id="L348" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="348"></td> <td id="LC348" class="blob-code blob-code-inner js-file-line"> p = <span class="pl-c1">UNESCAPE</span>(p);</td> </tr> <tr> <td id="L349" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="349"></td> <td id="LC349" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN</span>(<span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L350" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="350"></td> <td id="LC350" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L351" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="351"></td> <td id="LC351" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ISEND</span>(s))</td> </tr> <tr> <td id="L352" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="352"></td> <td id="LC352" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN</span>(FNM_NOMATCH);</td> </tr> <tr> <td id="L353" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="353"></td> <td id="LC353" class="blob-code blob-code-inner js-file-line"> ptmp = p;</td> </tr> <tr> <td id="L354" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="354"></td> <td id="LC354" class="blob-code blob-code-inner js-file-line"> stmp = s;</td> </tr> <tr> <td id="L355" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="355"></td> <td id="LC355" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L356" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="356"></td> <td id="LC356" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L357" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="357"></td> <td id="LC357" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>?<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L358" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="358"></td> <td id="LC358" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ISEND</span>(s))</td> </tr> <tr> <td id="L359" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="359"></td> <td id="LC359" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN</span>(FNM_NOMATCH);</td> </tr> <tr> <td id="L360" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="360"></td> <td id="LC360" class="blob-code blob-code-inner js-file-line"> p++;</td> </tr> <tr> <td id="L361" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="361"></td> <td id="LC361" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Inc</span>(s, send, enc);</td> </tr> <tr> <td id="L362" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="362"></td> <td id="LC362" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L363" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="363"></td> <td id="LC363" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L364" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="364"></td> <td id="LC364" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>[<span class="pl-pds">'</span></span>: {</td> </tr> <tr> <td id="L365" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="365"></td> <td id="LC365" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *t;</td> </tr> <tr> <td id="L366" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="366"></td> <td id="LC366" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ISEND</span>(s))</td> </tr> <tr> <td id="L367" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="367"></td> <td id="LC367" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN</span>(FNM_NOMATCH);</td> </tr> <tr> <td id="L368" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="368"></td> <td id="LC368" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> ((t = <span class="pl-c1">bracket</span>(p + <span class="pl-c1">1</span>, pend, s, send, flags, enc)) != <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L369" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="369"></td> <td id="LC369" class="blob-code blob-code-inner js-file-line"> p = t;</td> </tr> <tr> <td id="L370" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="370"></td> <td id="LC370" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Inc</span>(s, send, enc);</td> </tr> <tr> <td id="L371" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="371"></td> <td id="LC371" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L372" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="372"></td> <td id="LC372" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L373" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="373"></td> <td id="LC373" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> failed;</td> </tr> <tr> <td id="L374" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="374"></td> <td id="LC374" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L375" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="375"></td> <td id="LC375" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L376" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="376"></td> <td id="LC376" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L377" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="377"></td> <td id="LC377" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> ordinary <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L378" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="378"></td> <td id="LC378" class="blob-code blob-code-inner js-file-line"> p = <span class="pl-c1">UNESCAPE</span>(p);</td> </tr> <tr> <td id="L379" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="379"></td> <td id="LC379" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ISEND</span>(s))</td> </tr> <tr> <td id="L380" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="380"></td> <td id="LC380" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN</span>(<span class="pl-c1">ISEND</span>(p) ? <span class="pl-c1">0</span> : FNM_NOMATCH);</td> </tr> <tr> <td id="L381" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="381"></td> <td id="LC381" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ISEND</span>(p))</td> </tr> <tr> <td id="L382" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="382"></td> <td id="LC382" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> failed;</td> </tr> <tr> <td id="L383" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="383"></td> <td id="LC383" class="blob-code blob-code-inner js-file-line"> r = <span class="pl-c1">rb_enc_precise_mbclen</span>(p, pend, enc);</td> </tr> <tr> <td id="L384" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="384"></td> <td id="LC384" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">MBCLEN_CHARFOUND_P</span>(r))</td> </tr> <tr> <td id="L385" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="385"></td> <td id="LC385" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> failed;</td> </tr> <tr> <td id="L386" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="386"></td> <td id="LC386" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (r <= (send-s) && <span class="pl-c1">memcmp</span>(p, s, r) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L387" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="387"></td> <td id="LC387" class="blob-code blob-code-inner js-file-line"> p += r;</td> </tr> <tr> <td id="L388" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="388"></td> <td id="LC388" class="blob-code blob-code-inner js-file-line"> s += r;</td> </tr> <tr> <td id="L389" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="389"></td> <td id="LC389" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L390" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="390"></td> <td id="LC390" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L391" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="391"></td> <td id="LC391" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!nocase) <span class="pl-k">goto</span> failed;</td> </tr> <tr> <td id="L392" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="392"></td> <td id="LC392" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_enc_toupper</span>(<span class="pl-c1">rb_enc_codepoint</span>(p, pend, enc), enc) !=</td> </tr> <tr> <td id="L393" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="393"></td> <td id="LC393" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_enc_toupper</span>(<span class="pl-c1">rb_enc_codepoint</span>(s, send, enc), enc))</td> </tr> <tr> <td id="L394" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="394"></td> <td id="LC394" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> failed;</td> </tr> <tr> <td id="L395" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="395"></td> <td id="LC395" class="blob-code blob-code-inner js-file-line"> p += r;</td> </tr> <tr> <td id="L396" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="396"></td> <td id="LC396" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Inc</span>(s, send, enc);</td> </tr> <tr> <td id="L397" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="397"></td> <td id="LC397" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L398" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="398"></td> <td id="LC398" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L399" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="399"></td> <td id="LC399" class="blob-code blob-code-inner js-file-line"> failed: <span class="pl-c"><span class="pl-c">/*</span> try next '*' position <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L400" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="400"></td> <td id="LC400" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (ptmp && stmp) {</td> </tr> <tr> <td id="L401" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="401"></td> <td id="LC401" class="blob-code blob-code-inner js-file-line"> p = ptmp;</td> </tr> <tr> <td id="L402" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="402"></td> <td id="LC402" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Inc</span>(stmp, send, enc); <span class="pl-c"><span class="pl-c">/*</span> !ISEND(*stmp) <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L403" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="403"></td> <td id="LC403" class="blob-code blob-code-inner js-file-line"> s = stmp;</td> </tr> <tr> <td id="L404" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="404"></td> <td id="LC404" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L405" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="405"></td> <td id="LC405" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L406" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="406"></td> <td id="LC406" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN</span>(FNM_NOMATCH);</td> </tr> <tr> <td id="L407" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="407"></td> <td id="LC407" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L408" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="408"></td> <td id="LC408" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L409" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="409"></td> <td id="LC409" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L410" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="410"></td> <td id="LC410" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L411" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="411"></td> <td id="LC411" class="blob-code blob-code-inner js-file-line"><span class="pl-en">fnmatch</span>(</td> </tr> <tr> <td id="L412" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="412"></td> <td id="LC412" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *pattern,</td> </tr> <tr> <td id="L413" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="413"></td> <td id="LC413" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc,</td> </tr> <tr> <td id="L414" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="414"></td> <td id="LC414" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *string,</td> </tr> <tr> <td id="L415" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="415"></td> <td id="LC415" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags)</td> </tr> <tr> <td id="L416" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="416"></td> <td id="LC416" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L417" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="417"></td> <td id="LC417" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *p = pattern;</td> </tr> <tr> <td id="L418" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="418"></td> <td id="LC418" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *s = string;</td> </tr> <tr> <td id="L419" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="419"></td> <td id="LC419" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *send = s + <span class="pl-c1">strlen</span>(string);</td> </tr> <tr> <td id="L420" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="420"></td> <td id="LC420" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> period = !(flags & FNM_DOTMATCH);</td> </tr> <tr> <td id="L421" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="421"></td> <td id="LC421" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> pathname = flags & FNM_PATHNAME;</td> </tr> <tr> <td id="L422" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="422"></td> <td id="LC422" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L423" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="423"></td> <td id="LC423" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *ptmp = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L424" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="424"></td> <td id="LC424" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *stmp = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L425" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="425"></td> <td id="LC425" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L426" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="426"></td> <td id="LC426" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (pathname) {</td> </tr> <tr> <td id="L427" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="427"></td> <td id="LC427" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (<span class="pl-c1">1</span>) {</td> </tr> <tr> <td id="L428" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="428"></td> <td id="LC428" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (p[<span class="pl-c1">0</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">1</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">2</span>] == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L429" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="429"></td> <td id="LC429" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">do</span> { p += <span class="pl-c1">3</span>; } <span class="pl-k">while</span> (p[<span class="pl-c1">0</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">1</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">2</span>] == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>);</td> </tr> <tr> <td id="L430" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="430"></td> <td id="LC430" class="blob-code blob-code-inner js-file-line"> ptmp = p;</td> </tr> <tr> <td id="L431" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="431"></td> <td id="LC431" class="blob-code blob-code-inner js-file-line"> stmp = s;</td> </tr> <tr> <td id="L432" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="432"></td> <td id="LC432" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L433" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="433"></td> <td id="LC433" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">fnmatch_helper</span>(&p, &s, flags, enc) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L434" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="434"></td> <td id="LC434" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (*s && *s != <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>) <span class="pl-c1">Inc</span>(s, send, enc);</td> </tr> <tr> <td id="L435" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="435"></td> <td id="LC435" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p && *s) {</td> </tr> <tr> <td id="L436" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="436"></td> <td id="LC436" class="blob-code blob-code-inner js-file-line"> p++;</td> </tr> <tr> <td id="L437" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="437"></td> <td id="LC437" class="blob-code blob-code-inner js-file-line"> s++;</td> </tr> <tr> <td id="L438" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="438"></td> <td id="LC438" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L439" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="439"></td> <td id="LC439" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L440" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="440"></td> <td id="LC440" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!*p && !*s)</td> </tr> <tr> <td id="L441" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="441"></td> <td id="LC441" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L442" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="442"></td> <td id="LC442" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L443" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="443"></td> <td id="LC443" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> failed : try next recursion <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L444" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="444"></td> <td id="LC444" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (ptmp && stmp && !(period && *stmp == <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>)) {</td> </tr> <tr> <td id="L445" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="445"></td> <td id="LC445" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (*stmp && *stmp != <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>) <span class="pl-c1">Inc</span>(stmp, send, enc);</td> </tr> <tr> <td id="L446" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="446"></td> <td id="LC446" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*stmp) {</td> </tr> <tr> <td id="L447" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="447"></td> <td id="LC447" class="blob-code blob-code-inner js-file-line"> p = ptmp;</td> </tr> <tr> <td id="L448" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="448"></td> <td id="LC448" class="blob-code blob-code-inner js-file-line"> stmp++;</td> </tr> <tr> <td id="L449" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="449"></td> <td id="LC449" class="blob-code blob-code-inner js-file-line"> s = stmp;</td> </tr> <tr> <td id="L450" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="450"></td> <td id="LC450" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L451" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="451"></td> <td id="LC451" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L452" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="452"></td> <td id="LC452" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L453" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="453"></td> <td id="LC453" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> FNM_NOMATCH;</td> </tr> <tr> <td id="L454" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="454"></td> <td id="LC454" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L455" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="455"></td> <td id="LC455" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L456" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="456"></td> <td id="LC456" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L457" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="457"></td> <td id="LC457" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">fnmatch_helper</span>(&p, &s, flags, enc);</td> </tr> <tr> <td id="L458" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="458"></td> <td id="LC458" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L459" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="459"></td> <td id="LC459" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L460" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="460"></td> <td id="LC460" class="blob-code blob-code-inner js-file-line">VALUE rb_cDir;</td> </tr> <tr> <td id="L461" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="461"></td> <td id="LC461" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L462" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="462"></td> <td id="LC462" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> dir_data {</td> </tr> <tr> <td id="L463" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="463"></td> <td id="LC463" class="blob-code blob-code-inner js-file-line"> DIR *dir;</td> </tr> <tr> <td id="L464" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="464"></td> <td id="LC464" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> VALUE path;</td> </tr> <tr> <td id="L465" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="465"></td> <td id="LC465" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc;</td> </tr> <tr> <td id="L466" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="466"></td> <td id="LC466" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L467" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="467"></td> <td id="LC467" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L468" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="468"></td> <td id="LC468" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L469" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="469"></td> <td id="LC469" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_free</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L470" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="470"></td> <td id="LC470" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L471" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="471"></td> <td id="LC471" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dir = ptr;</td> </tr> <tr> <td id="L472" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="472"></td> <td id="LC472" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L473" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="473"></td> <td id="LC473" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dir-><span class="pl-smi">dir</span>) <span class="pl-c1">closedir</span>(dir-><span class="pl-smi">dir</span>);</td> </tr> <tr> <td id="L474" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="474"></td> <td id="LC474" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">xfree</span>(dir);</td> </tr> <tr> <td id="L475" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="475"></td> <td id="LC475" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L476" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="476"></td> <td id="LC476" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L477" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="477"></td> <td id="LC477" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-c1">size_t</span></td> </tr> <tr> <td id="L478" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="478"></td> <td id="LC478" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_memsize</span>(<span class="pl-k">const</span> <span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L479" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="479"></td> <td id="LC479" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L480" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="480"></td> <td id="LC480" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-k">sizeof</span>(<span class="pl-k">struct</span> dir_data);</td> </tr> <tr> <td id="L481" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="481"></td> <td id="LC481" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L482" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="482"></td> <td id="LC482" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L483" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="483"></td> <td id="LC483" class="blob-code blob-code-inner js-file-line"><span class="pl-en">RUBY_REFERENCES_START</span>(dir_refs)</td> </tr> <tr> <td id="L484" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="484"></td> <td id="LC484" class="blob-code blob-code-inner js-file-line"> REF_EDGE(dir_data, path),</td> </tr> <tr> <td id="L485" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="485"></td> <td id="LC485" class="blob-code blob-code-inner js-file-line">RUBY_REFERENCES_END</td> </tr> <tr> <td id="L486" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="486"></td> <td id="LC486" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L487" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="487"></td> <td id="LC487" class="blob-code blob-code-inner js-file-line">static <span class="pl-k">const</span> rb_data_type_t dir_data_type = {</td> </tr> <tr> <td id="L488" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="488"></td> <td id="LC488" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">"</span>dir<span class="pl-pds">"</span></span>,</td> </tr> <tr> <td id="L489" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="489"></td> <td id="LC489" class="blob-code blob-code-inner js-file-line"> {<span class="pl-c1">REFS_LIST_PTR</span>(dir_refs), dir_free, dir_memsize,},</td> </tr> <tr> <td id="L490" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="490"></td> <td id="LC490" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">0</span>, <span class="pl-c1">NULL</span>, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_DECL_MARKING</td> </tr> <tr> <td id="L491" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="491"></td> <td id="LC491" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L492" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="492"></td> <td id="LC492" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L493" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="493"></td> <td id="LC493" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE <span class="pl-en">dir_close</span>(VALUE);</td> </tr> <tr> <td id="L494" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="494"></td> <td id="LC494" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L495" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="495"></td> <td id="LC495" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L496" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="496"></td> <td id="LC496" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_alloc</span>(VALUE klass)</td> </tr> <tr> <td id="L497" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="497"></td> <td id="LC497" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L498" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="498"></td> <td id="LC498" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L499" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="499"></td> <td id="LC499" class="blob-code blob-code-inner js-file-line"> VALUE obj = <span class="pl-c1">TypedData_Make_Struct</span>(klass, <span class="pl-k">struct</span> dir_data, &dir_data_type, dirp);</td> </tr> <tr> <td id="L500" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="500"></td> <td id="LC500" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L501" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="501"></td> <td id="LC501" class="blob-code blob-code-inner js-file-line"> dirp-><span class="pl-smi">dir</span> = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L502" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="502"></td> <td id="LC502" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_OBJ_WRITE</span>(obj, &dirp-><span class="pl-smi">path</span>, Qnil);</td> </tr> <tr> <td id="L503" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="503"></td> <td id="LC503" class="blob-code blob-code-inner js-file-line"> dirp-><span class="pl-smi">enc</span> = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L504" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="504"></td> <td id="LC504" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L505" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="505"></td> <td id="LC505" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> obj;</td> </tr> <tr> <td id="L506" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="506"></td> <td id="LC506" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L507" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="507"></td> <td id="LC507" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L508" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="508"></td> <td id="LC508" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L509" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="509"></td> <td id="LC509" class="blob-code blob-code-inner js-file-line"><span class="pl-en">nogvl_opendir</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L510" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="510"></td> <td id="LC510" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L511" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="511"></td> <td id="LC511" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path = ptr;</td> </tr> <tr> <td id="L512" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="512"></td> <td id="LC512" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L513" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="513"></td> <td id="LC513" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)<span class="pl-c1">opendir</span>(path);</td> </tr> <tr> <td id="L514" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="514"></td> <td id="LC514" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L515" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="515"></td> <td id="LC515" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L516" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="516"></td> <td id="LC516" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> DIR *</td> </tr> <tr> <td id="L517" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="517"></td> <td id="LC517" class="blob-code blob-code-inner js-file-line"><span class="pl-en">opendir_without_gvl</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path)</td> </tr> <tr> <td id="L518" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="518"></td> <td id="LC518" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L519" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="519"></td> <td id="LC519" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (vm_initialized) {</td> </tr> <tr> <td id="L520" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="520"></td> <td id="LC520" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">union</span> { <span class="pl-k">const</span> <span class="pl-k">void</span> *in; <span class="pl-k">void</span> *out; } u;</td> </tr> <tr> <td id="L521" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="521"></td> <td id="LC521" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L522" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="522"></td> <td id="LC522" class="blob-code blob-code-inner js-file-line"> u.<span class="pl-smi">in</span> = path;</td> </tr> <tr> <td id="L523" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="523"></td> <td id="LC523" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L524" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="524"></td> <td id="LC524" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_thread_call_without_gvl</span>(nogvl_opendir, u.<span class="pl-smi">out</span>, RUBY_UBF_IO, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L525" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="525"></td> <td id="LC525" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L526" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="526"></td> <td id="LC526" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L527" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="527"></td> <td id="LC527" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">opendir</span>(path);</td> </tr> <tr> <td id="L528" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="528"></td> <td id="LC528" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L529" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="529"></td> <td id="LC529" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L530" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="530"></td> <td id="LC530" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L531" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="531"></td> <td id="LC531" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_initialize</span>(<span class="pl-c1">rb_execution_context_t</span> *ec, VALUE dir, VALUE dirname, VALUE enc)</td> </tr> <tr> <td id="L532" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="532"></td> <td id="LC532" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L533" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="533"></td> <td id="LC533" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dp;</td> </tr> <tr> <td id="L534" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="534"></td> <td id="LC534" class="blob-code blob-code-inner js-file-line"> VALUE orig;</td> </tr> <tr> <td id="L535" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="535"></td> <td id="LC535" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L536" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="536"></td> <td id="LC536" class="blob-code blob-code-inner js-file-line"> rb_encoding *fsenc = <span class="pl-c1">NIL_P</span>(enc) ? <span class="pl-c1">rb_filesystem_encoding</span>() : <span class="pl-c1">rb_to_encoding</span>(enc);</td> </tr> <tr> <td id="L537" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="537"></td> <td id="LC537" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L538" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="538"></td> <td id="LC538" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FilePathValue</span>(dirname);</td> </tr> <tr> <td id="L539" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="539"></td> <td id="LC539" class="blob-code blob-code-inner js-file-line"> orig = <span class="pl-c1">rb_str_dup_frozen</span>(dirname);</td> </tr> <tr> <td id="L540" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="540"></td> <td id="LC540" class="blob-code blob-code-inner js-file-line"> dirname = <span class="pl-c1">rb_str_encode_ospath</span>(dirname);</td> </tr> <tr> <td id="L541" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="541"></td> <td id="LC541" class="blob-code blob-code-inner js-file-line"> dirname = <span class="pl-c1">rb_str_dup_frozen</span>(dirname);</td> </tr> <tr> <td id="L542" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="542"></td> <td id="LC542" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L543" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="543"></td> <td id="LC543" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">TypedData_Get_Struct</span>(dir, <span class="pl-k">struct</span> dir_data, &dir_data_type, dp);</td> </tr> <tr> <td id="L544" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="544"></td> <td id="LC544" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dp-><span class="pl-smi">dir</span>) <span class="pl-c1">closedir</span>(dp-><span class="pl-smi">dir</span>);</td> </tr> <tr> <td id="L545" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="545"></td> <td id="LC545" class="blob-code blob-code-inner js-file-line"> dp-><span class="pl-smi">dir</span> = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L546" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="546"></td> <td id="LC546" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_OBJ_WRITE</span>(dir, &dp-><span class="pl-smi">path</span>, Qnil);</td> </tr> <tr> <td id="L547" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="547"></td> <td id="LC547" class="blob-code blob-code-inner js-file-line"> dp-><span class="pl-smi">enc</span> = fsenc;</td> </tr> <tr> <td id="L548" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="548"></td> <td id="LC548" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">RSTRING_PTR</span>(dirname);</td> </tr> <tr> <td id="L549" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="549"></td> <td id="LC549" class="blob-code blob-code-inner js-file-line"> dp-><span class="pl-smi">dir</span> = <span class="pl-c1">opendir_without_gvl</span>(path);</td> </tr> <tr> <td id="L550" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="550"></td> <td id="LC550" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dp-><span class="pl-smi">dir</span> == <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L551" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="551"></td> <td id="LC551" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> e = errno;</td> </tr> <tr> <td id="L552" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="552"></td> <td id="LC552" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_gc_for_fd</span>(e)) {</td> </tr> <tr> <td id="L553" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="553"></td> <td id="LC553" class="blob-code blob-code-inner js-file-line"> dp-><span class="pl-smi">dir</span> = <span class="pl-c1">opendir_without_gvl</span>(path);</td> </tr> <tr> <td id="L554" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="554"></td> <td id="LC554" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L555" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="555"></td> <td id="LC555" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_GETATTRLIST</td> </tr> <tr> <td id="L556" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="556"></td> <td id="LC556" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-k">if</span> (e == EIO) {</td> </tr> <tr> <td id="L557" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="557"></td> <td id="LC557" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">u_int32_t</span> attrbuf[<span class="pl-c1">1</span>];</td> </tr> <tr> <td id="L558" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="558"></td> <td id="LC558" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> attrlist al = {ATTR_BIT_MAP_COUNT, <span class="pl-c1">0</span>};</td> </tr> <tr> <td id="L559" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="559"></td> <td id="LC559" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">getattrlist</span>(path, &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), FSOPT_NOFOLLOW) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L560" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="560"></td> <td id="LC560" class="blob-code blob-code-inner js-file-line"> dp-><span class="pl-smi">dir</span> = <span class="pl-c1">opendir_without_gvl</span>(path);</td> </tr> <tr> <td id="L561" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="561"></td> <td id="LC561" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L562" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="562"></td> <td id="LC562" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L563" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="563"></td> <td id="LC563" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L564" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="564"></td> <td id="LC564" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dp-><span class="pl-smi">dir</span> == <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L565" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="565"></td> <td id="LC565" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_GC_GUARD</span>(dirname);</td> </tr> <tr> <td id="L566" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="566"></td> <td id="LC566" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_syserr_fail_path</span>(e, orig);</td> </tr> <tr> <td id="L567" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="567"></td> <td id="LC567" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L568" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="568"></td> <td id="LC568" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L569" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="569"></td> <td id="LC569" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_OBJ_WRITE</span>(dir, &dp-><span class="pl-smi">path</span>, orig);</td> </tr> <tr> <td id="L570" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="570"></td> <td id="LC570" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L571" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="571"></td> <td id="LC571" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dir;</td> </tr> <tr> <td id="L572" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="572"></td> <td id="LC572" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L573" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="573"></td> <td id="LC573" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L574" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="574"></td> <td id="LC574" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L575" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="575"></td> <td id="LC575" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_open</span>(<span class="pl-c1">rb_execution_context_t</span> *ec, VALUE klass, VALUE dirname, VALUE enc)</td> </tr> <tr> <td id="L576" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="576"></td> <td id="LC576" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L577" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="577"></td> <td id="LC577" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dp;</td> </tr> <tr> <td id="L578" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="578"></td> <td id="LC578" class="blob-code blob-code-inner js-file-line"> VALUE dir = <span class="pl-c1">TypedData_Make_Struct</span>(klass, <span class="pl-k">struct</span> dir_data, &dir_data_type, dp);</td> </tr> <tr> <td id="L579" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="579"></td> <td id="LC579" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L580" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="580"></td> <td id="LC580" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_initialize</span>(ec, dir, dirname, enc);</td> </tr> <tr> <td id="L581" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="581"></td> <td id="LC581" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L582" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="582"></td> <td id="LC582" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dir;</td> </tr> <tr> <td id="L583" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="583"></td> <td id="LC583" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L584" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="584"></td> <td id="LC584" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L585" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="585"></td> <td id="LC585" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L586" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="586"></td> <td id="LC586" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_close</span>(<span class="pl-c1">rb_execution_context_t</span> *ec, VALUE klass, VALUE dir)</td> </tr> <tr> <td id="L587" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="587"></td> <td id="LC587" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L588" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="588"></td> <td id="LC588" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">dir_close</span>(dir);</td> </tr> <tr> <td id="L589" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="589"></td> <td id="LC589" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L590" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="590"></td> <td id="LC590" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L591" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="591"></td> <td id="LC591" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD)</td> </tr> <tr> <td id="L592" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="592"></td> <td id="LC592" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L593" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="593"></td> <td id="LC593" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L594" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="594"></td> <td id="LC594" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.for_fd(integer) -> aDir</span></td> </tr> <tr> <td id="L595" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="595"></td> <td id="LC595" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L596" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="596"></td> <td id="LC596" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns a Dir representing the directory specified by the given</span></td> </tr> <tr> <td id="L597" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="597"></td> <td id="LC597" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory file descriptor. Note that the returned Dir will not</span></td> </tr> <tr> <td id="L598" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="598"></td> <td id="LC598" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * have an associated path.</span></td> </tr> <tr> <td id="L599" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="599"></td> <td id="LC599" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L600" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="600"></td> <td id="LC600" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d1 = Dir.new('..')</span></td> </tr> <tr> <td id="L601" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="601"></td> <td id="LC601" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d2 = Dir.for_fd(d1.fileno)</span></td> </tr> <tr> <td id="L602" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="602"></td> <td id="LC602" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d1.path # => '..'</span></td> </tr> <tr> <td id="L603" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="603"></td> <td id="LC603" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d2.path # => nil</span></td> </tr> <tr> <td id="L604" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="604"></td> <td id="LC604" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d1.chdir{Dir.pwd} == d2.chdir{Dir.pwd} # => true</span></td> </tr> <tr> <td id="L605" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="605"></td> <td id="LC605" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L606" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="606"></td> <td id="LC606" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * This method uses fdopendir() function defined by POSIX 2008.</span></td> </tr> <tr> <td id="L607" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="607"></td> <td id="LC607" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * NotImplementedError is raised on other platforms, such as Windows,</span></td> </tr> <tr> <td id="L608" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="608"></td> <td id="LC608" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * which doesn't provide the function.</span></td> </tr> <tr> <td id="L609" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="609"></td> <td id="LC609" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L610" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="610"></td> <td id="LC610" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L611" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="611"></td> <td id="LC611" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L612" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="612"></td> <td id="LC612" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_for_fd</span>(VALUE klass, VALUE fd)</td> </tr> <tr> <td id="L613" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="613"></td> <td id="LC613" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L614" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="614"></td> <td id="LC614" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dp;</td> </tr> <tr> <td id="L615" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="615"></td> <td id="LC615" class="blob-code blob-code-inner js-file-line"> VALUE dir = <span class="pl-c1">TypedData_Make_Struct</span>(klass, <span class="pl-k">struct</span> dir_data, &dir_data_type, dp);</td> </tr> <tr> <td id="L616" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="616"></td> <td id="LC616" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L617" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="617"></td> <td id="LC617" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!(dp-><span class="pl-smi">dir</span> = <span class="pl-c1">fdopendir</span>(<span class="pl-c1">NUM2INT</span>(fd)))) {</td> </tr> <tr> <td id="L618" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="618"></td> <td id="LC618" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail</span>(<span class="pl-s"><span class="pl-pds">"</span>fdopendir<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L619" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="619"></td> <td id="LC619" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">UNREACHABLE_RETURN</span>(Qnil);</td> </tr> <tr> <td id="L620" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="620"></td> <td id="LC620" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L621" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="621"></td> <td id="LC621" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L622" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="622"></td> <td id="LC622" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_OBJ_WRITE</span>(dir, &dp-><span class="pl-smi">path</span>, Qnil);</td> </tr> <tr> <td id="L623" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="623"></td> <td id="LC623" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dir;</td> </tr> <tr> <td id="L624" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="624"></td> <td id="LC624" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L625" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="625"></td> <td id="LC625" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L626" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="626"></td> <td id="LC626" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">dir_s_for_fd</span> rb_f_notimplement</td> </tr> <tr> <td id="L627" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="627"></td> <td id="LC627" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L628" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="628"></td> <td id="LC628" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L629" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="629"></td> <td id="LC629" class="blob-code blob-code-inner js-file-line"><span class="pl-en">NORETURN</span>(<span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">dir_closed</span>(<span class="pl-k">void</span>));</td> </tr> <tr> <td id="L630" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="630"></td> <td id="LC630" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L631" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="631"></td> <td id="LC631" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L632" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="632"></td> <td id="LC632" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_closed</span>(<span class="pl-k">void</span>)</td> </tr> <tr> <td id="L633" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="633"></td> <td id="LC633" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L634" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="634"></td> <td id="LC634" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_raise</span>(rb_eIOError, <span class="pl-s"><span class="pl-pds">"</span>closed directory<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L635" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="635"></td> <td id="LC635" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L636" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="636"></td> <td id="LC636" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L637" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="637"></td> <td id="LC637" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">struct</span> dir_data *</td> </tr> <tr> <td id="L638" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="638"></td> <td id="LC638" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_get</span>(VALUE dir)</td> </tr> <tr> <td id="L639" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="639"></td> <td id="LC639" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L640" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="640"></td> <td id="LC640" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_check_frozen</span>(dir);</td> </tr> <tr> <td id="L641" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="641"></td> <td id="LC641" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_check_typeddata</span>(dir, &dir_data_type);</td> </tr> <tr> <td id="L642" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="642"></td> <td id="LC642" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L643" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="643"></td> <td id="LC643" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L644" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="644"></td> <td id="LC644" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">struct</span> dir_data *</td> </tr> <tr> <td id="L645" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="645"></td> <td id="LC645" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_check</span>(VALUE dir)</td> </tr> <tr> <td id="L646" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="646"></td> <td id="LC646" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L647" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="647"></td> <td id="LC647" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp = <span class="pl-c1">dir_get</span>(dir);</td> </tr> <tr> <td id="L648" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="648"></td> <td id="LC648" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dirp-><span class="pl-smi">dir</span>) <span class="pl-c1">dir_closed</span>();</td> </tr> <tr> <td id="L649" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="649"></td> <td id="LC649" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dirp;</td> </tr> <tr> <td id="L650" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="650"></td> <td id="LC650" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L651" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="651"></td> <td id="LC651" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L652" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="652"></td> <td id="LC652" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GetDIR</span>(<span class="pl-v">obj, dirp</span>) ((dirp) = dir_check(obj))</td> </tr> <tr> <td id="L653" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="653"></td> <td id="LC653" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L654" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="654"></td> <td id="LC654" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L655" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="655"></td> <td id="LC655" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L656" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="656"></td> <td id="LC656" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L657" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="657"></td> <td id="LC657" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.inspect -> string</span></td> </tr> <tr> <td id="L658" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="658"></td> <td id="LC658" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L659" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="659"></td> <td id="LC659" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Return a string describing this Dir object.</span></td> </tr> <tr> <td id="L660" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="660"></td> <td id="LC660" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L661" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="661"></td> <td id="LC661" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L662" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="662"></td> <td id="LC662" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_inspect</span>(VALUE dir)</td> </tr> <tr> <td id="L663" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="663"></td> <td id="LC663" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L664" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="664"></td> <td id="LC664" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L665" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="665"></td> <td id="LC665" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L666" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="666"></td> <td id="LC666" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">TypedData_Get_Struct</span>(dir, <span class="pl-k">struct</span> dir_data, &dir_data_type, dirp);</td> </tr> <tr> <td id="L667" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="667"></td> <td id="LC667" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">NIL_P</span>(dirp-><span class="pl-smi">path</span>)) {</td> </tr> <tr> <td id="L668" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="668"></td> <td id="LC668" class="blob-code blob-code-inner js-file-line"> VALUE str = <span class="pl-c1">rb_str_new_cstr</span>(<span class="pl-s"><span class="pl-pds">"</span>#<<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L669" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="669"></td> <td id="LC669" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_str_append</span>(str, <span class="pl-c1">rb_class_name</span>(<span class="pl-c1">CLASS_OF</span>(dir)));</td> </tr> <tr> <td id="L670" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="670"></td> <td id="LC670" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_str_cat2</span>(str, <span class="pl-s"><span class="pl-pds">"</span>:<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L671" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="671"></td> <td id="LC671" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_str_append</span>(str, dirp-><span class="pl-smi">path</span>);</td> </tr> <tr> <td id="L672" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="672"></td> <td id="LC672" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_str_cat2</span>(str, <span class="pl-s"><span class="pl-pds">"</span>><span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L673" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="673"></td> <td id="LC673" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> str;</td> </tr> <tr> <td id="L674" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="674"></td> <td id="LC674" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L675" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="675"></td> <td id="LC675" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_funcallv</span>(dir, idTo_s, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L676" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="676"></td> <td id="LC676" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L677" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="677"></td> <td id="LC677" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L678" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="678"></td> <td id="LC678" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> Workaround for Solaris 10 that does not have dirfd.</span></td> </tr> <tr> <td id="L679" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="679"></td> <td id="LC679" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Note: Solaris 11 (POSIX.1-2008 compliant) has dirfd(3C).</span></td> </tr> <tr> <td id="L680" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="680"></td> <td id="LC680" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L681" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="681"></td> <td id="LC681" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined(__sun) && !defined(HAVE_DIRFD)</td> </tr> <tr> <td id="L682" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="682"></td> <td id="LC682" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined(HAVE_DIR_D_FD)</td> </tr> <tr> <td id="L683" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="683"></td> <td id="LC683" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">dirfd</span>(<span class="pl-v">x</span>) ((x)->d_fd)</td> </tr> <tr> <td id="L684" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="684"></td> <td id="LC684" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">HAVE_DIRFD</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L685" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="685"></td> <td id="LC685" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">elif</span> defined(HAVE_DIR_DD_FD)</td> </tr> <tr> <td id="L686" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="686"></td> <td id="LC686" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">dirfd</span>(<span class="pl-v">x</span>) ((x)->dd_fd)</td> </tr> <tr> <td id="L687" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="687"></td> <td id="LC687" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">HAVE_DIRFD</span> <span class="pl-c1">1</span></td> </tr> <tr> <td id="L688" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="688"></td> <td id="LC688" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L689" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="689"></td> <td id="LC689" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L690" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="690"></td> <td id="LC690" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L691" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="691"></td> <td id="LC691" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_DIRFD</td> </tr> <tr> <td id="L692" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="692"></td> <td id="LC692" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L693" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="693"></td> <td id="LC693" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L694" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="694"></td> <td id="LC694" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.fileno -> integer</span></td> </tr> <tr> <td id="L695" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="695"></td> <td id="LC695" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L696" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="696"></td> <td id="LC696" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns the file descriptor used in <em>dir</em>.</span></td> </tr> <tr> <td id="L697" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="697"></td> <td id="LC697" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L698" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="698"></td> <td id="LC698" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("..")</span></td> </tr> <tr> <td id="L699" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="699"></td> <td id="LC699" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.fileno #=> 8</span></td> </tr> <tr> <td id="L700" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="700"></td> <td id="LC700" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L701" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="701"></td> <td id="LC701" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * This method uses dirfd() function defined by POSIX 2008.</span></td> </tr> <tr> <td id="L702" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="702"></td> <td id="LC702" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * NotImplementedError is raised on other platforms, such as Windows,</span></td> </tr> <tr> <td id="L703" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="703"></td> <td id="LC703" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * which doesn't provide the function.</span></td> </tr> <tr> <td id="L704" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="704"></td> <td id="LC704" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L705" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="705"></td> <td id="LC705" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L706" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="706"></td> <td id="LC706" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L707" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="707"></td> <td id="LC707" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_fileno</span>(VALUE dir)</td> </tr> <tr> <td id="L708" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="708"></td> <td id="LC708" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L709" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="709"></td> <td id="LC709" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L710" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="710"></td> <td id="LC710" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd;</td> </tr> <tr> <td id="L711" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="711"></td> <td id="LC711" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L712" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="712"></td> <td id="LC712" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GetDIR</span>(dir, dirp);</td> </tr> <tr> <td id="L713" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="713"></td> <td id="LC713" class="blob-code blob-code-inner js-file-line"> fd = <span class="pl-c1">dirfd</span>(dirp-><span class="pl-smi">dir</span>);</td> </tr> <tr> <td id="L714" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="714"></td> <td id="LC714" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (fd == -<span class="pl-c1">1</span>)</td> </tr> <tr> <td id="L715" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="715"></td> <td id="LC715" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail</span>(<span class="pl-s"><span class="pl-pds">"</span>dirfd<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L716" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="716"></td> <td id="LC716" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">INT2NUM</span>(fd);</td> </tr> <tr> <td id="L717" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="717"></td> <td id="LC717" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L718" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="718"></td> <td id="LC718" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L719" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="719"></td> <td id="LC719" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">dir_fileno</span> rb_f_notimplement</td> </tr> <tr> <td id="L720" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="720"></td> <td id="LC720" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L721" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="721"></td> <td id="LC721" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L722" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="722"></td> <td id="LC722" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L723" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="723"></td> <td id="LC723" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L724" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="724"></td> <td id="LC724" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.path -> string or nil</span></td> </tr> <tr> <td id="L725" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="725"></td> <td id="LC725" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.to_path -> string or nil</span></td> </tr> <tr> <td id="L726" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="726"></td> <td id="LC726" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L727" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="727"></td> <td id="LC727" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns the path parameter passed to <em>dir</em>'s constructor.</span></td> </tr> <tr> <td id="L728" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="728"></td> <td id="LC728" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L729" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="729"></td> <td id="LC729" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("..")</span></td> </tr> <tr> <td id="L730" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="730"></td> <td id="LC730" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.path #=> ".."</span></td> </tr> <tr> <td id="L731" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="731"></td> <td id="LC731" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L732" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="732"></td> <td id="LC732" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L733" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="733"></td> <td id="LC733" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_path</span>(VALUE dir)</td> </tr> <tr> <td id="L734" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="734"></td> <td id="LC734" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L735" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="735"></td> <td id="LC735" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L736" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="736"></td> <td id="LC736" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L737" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="737"></td> <td id="LC737" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">TypedData_Get_Struct</span>(dir, <span class="pl-k">struct</span> dir_data, &dir_data_type, dirp);</td> </tr> <tr> <td id="L738" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="738"></td> <td id="LC738" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">NIL_P</span>(dirp-><span class="pl-smi">path</span>)) <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L739" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="739"></td> <td id="LC739" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_str_dup</span>(dirp-><span class="pl-smi">path</span>);</td> </tr> <tr> <td id="L740" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="740"></td> <td id="LC740" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L741" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="741"></td> <td id="LC741" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L742" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="742"></td> <td id="LC742" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined _WIN32</td> </tr> <tr> <td id="L743" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="743"></td> <td id="LC743" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L744" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="744"></td> <td id="LC744" class="blob-code blob-code-inner js-file-line"><span class="pl-en">fundamental_encoding_p</span>(rb_encoding *enc)</td> </tr> <tr> <td id="L745" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="745"></td> <td id="LC745" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L746" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="746"></td> <td id="LC746" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (<span class="pl-c1">rb_enc_to_index</span>(enc)) {</td> </tr> <tr> <td id="L747" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="747"></td> <td id="LC747" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ENCINDEX_ASCII_8BIT:</td> </tr> <tr> <td id="L748" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="748"></td> <td id="LC748" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ENCINDEX_US_ASCII:</td> </tr> <tr> <td id="L749" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="749"></td> <td id="LC749" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ENCINDEX_UTF_8:</td> </tr> <tr> <td id="L750" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="750"></td> <td id="LC750" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L751" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="751"></td> <td id="LC751" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L752" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="752"></td> <td id="LC752" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L753" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="753"></td> <td id="LC753" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L754" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="754"></td> <td id="LC754" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L755" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="755"></td> <td id="LC755" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">READDIR</span>(<span class="pl-v">dir, enc</span>) rb_w32_readdir((dir), (enc))</td> </tr> <tr> <td id="L756" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="756"></td> <td id="LC756" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L757" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="757"></td> <td id="LC757" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">READDIR</span>(<span class="pl-v">dir, enc</span>) readdir((dir))</td> </tr> <tr> <td id="L758" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="758"></td> <td id="LC758" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L759" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="759"></td> <td id="LC759" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L760" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="760"></td> <td id="LC760" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> safe to use without GVL <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L761" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="761"></td> <td id="LC761" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L762" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="762"></td> <td id="LC762" class="blob-code blob-code-inner js-file-line"><span class="pl-en">to_be_skipped</span>(<span class="pl-k">const</span> <span class="pl-k">struct</span> dirent *dp)</td> </tr> <tr> <td id="L763" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="763"></td> <td id="LC763" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L764" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="764"></td> <td id="LC764" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *name = dp-><span class="pl-smi">d_name</span>;</td> </tr> <tr> <td id="L765" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="765"></td> <td id="LC765" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (name[<span class="pl-c1">0</span>] != <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) <span class="pl-k">return</span> <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L766" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="766"></td> <td id="LC766" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_DIRENT_NAMLEN</td> </tr> <tr> <td id="L767" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="767"></td> <td id="LC767" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (<span class="pl-c1">NAMLEN</span>(dp)) {</td> </tr> <tr> <td id="L768" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="768"></td> <td id="LC768" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-c1">2</span>:</td> </tr> <tr> <td id="L769" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="769"></td> <td id="LC769" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (name[<span class="pl-c1">1</span>] != <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) <span class="pl-k">return</span> <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L770" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="770"></td> <td id="LC770" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-c1">1</span>:</td> </tr> <tr> <td id="L771" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="771"></td> <td id="LC771" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L772" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="772"></td> <td id="LC772" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L773" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="773"></td> <td id="LC773" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L774" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="774"></td> <td id="LC774" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L775" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="775"></td> <td id="LC775" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L776" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="776"></td> <td id="LC776" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!name[<span class="pl-c1">1</span>]) <span class="pl-k">return</span> <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L777" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="777"></td> <td id="LC777" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (name[<span class="pl-c1">1</span>] != <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) <span class="pl-k">return</span> <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L778" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="778"></td> <td id="LC778" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!name[<span class="pl-c1">2</span>]) <span class="pl-k">return</span> <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L779" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="779"></td> <td id="LC779" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L780" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="780"></td> <td id="LC780" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L781" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="781"></td> <td id="LC781" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L782" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="782"></td> <td id="LC782" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L783" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="783"></td> <td id="LC783" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L784" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="784"></td> <td id="LC784" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L785" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="785"></td> <td id="LC785" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.read -> string or nil</span></td> </tr> <tr> <td id="L786" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="786"></td> <td id="LC786" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L787" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="787"></td> <td id="LC787" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Reads the next entry from <em>dir</em> and returns it as a string.</span></td> </tr> <tr> <td id="L788" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="788"></td> <td id="LC788" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns <code>nil</code> at the end of the stream.</span></td> </tr> <tr> <td id="L789" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="789"></td> <td id="LC789" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L790" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="790"></td> <td id="LC790" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir")</span></td> </tr> <tr> <td id="L791" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="791"></td> <td id="LC791" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> "."</span></td> </tr> <tr> <td id="L792" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="792"></td> <td id="LC792" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> ".."</span></td> </tr> <tr> <td id="L793" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="793"></td> <td id="LC793" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> "config.h"</span></td> </tr> <tr> <td id="L794" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="794"></td> <td id="LC794" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L795" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="795"></td> <td id="LC795" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L796" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="796"></td> <td id="LC796" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_read</span>(VALUE dir)</td> </tr> <tr> <td id="L797" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="797"></td> <td id="LC797" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L798" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="798"></td> <td id="LC798" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L799" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="799"></td> <td id="LC799" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dirent *dp;</td> </tr> <tr> <td id="L800" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="800"></td> <td id="LC800" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L801" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="801"></td> <td id="LC801" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GetDIR</span>(dir, dirp);</td> </tr> <tr> <td id="L802" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="802"></td> <td id="LC802" class="blob-code blob-code-inner js-file-line"> errno = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L803" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="803"></td> <td id="LC803" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> ((dp = <span class="pl-c1">READDIR</span>(dirp-><span class="pl-smi">dir</span>, dirp-><span class="pl-smi">enc</span>)) != <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L804" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="804"></td> <td id="LC804" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_external_str_new_with_enc</span>(dp-><span class="pl-smi">d_name</span>, <span class="pl-c1">NAMLEN</span>(dp), dirp-><span class="pl-smi">enc</span>);</td> </tr> <tr> <td id="L805" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="805"></td> <td id="LC805" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L806" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="806"></td> <td id="LC806" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L807" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="807"></td> <td id="LC807" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> e = errno;</td> </tr> <tr> <td id="L808" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="808"></td> <td id="LC808" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (e != <span class="pl-c1">0</span>) <span class="pl-c1">rb_syserr_fail</span>(e, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L809" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="809"></td> <td id="LC809" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil; <span class="pl-c"><span class="pl-c">/*</span> end of stream <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L810" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="810"></td> <td id="LC810" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L811" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="811"></td> <td id="LC811" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L812" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="812"></td> <td id="LC812" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L813" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="813"></td> <td id="LC813" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE <span class="pl-en">dir_each_entry</span>(VALUE, VALUE (*)(VALUE, VALUE), VALUE, int);</td> </tr> <tr> <td id="L814" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="814"></td> <td id="LC814" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L815" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="815"></td> <td id="LC815" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L816" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="816"></td> <td id="LC816" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_yield</span>(VALUE arg, VALUE path)</td> </tr> <tr> <td id="L817" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="817"></td> <td id="LC817" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L818" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="818"></td> <td id="LC818" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_yield</span>(path);</td> </tr> <tr> <td id="L819" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="819"></td> <td id="LC819" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L820" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="820"></td> <td id="LC820" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L821" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="821"></td> <td id="LC821" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L822" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="822"></td> <td id="LC822" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L823" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="823"></td> <td id="LC823" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.each { |filename| block } -> dir</span></td> </tr> <tr> <td id="L824" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="824"></td> <td id="LC824" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.each -> an_enumerator</span></td> </tr> <tr> <td id="L825" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="825"></td> <td id="LC825" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L826" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="826"></td> <td id="LC826" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Calls the block once for each entry in this directory, passing the</span></td> </tr> <tr> <td id="L827" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="827"></td> <td id="LC827" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * filename of each entry as a parameter to the block.</span></td> </tr> <tr> <td id="L828" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="828"></td> <td id="LC828" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L829" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="829"></td> <td id="LC829" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * If no block is given, an enumerator is returned instead.</span></td> </tr> <tr> <td id="L830" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="830"></td> <td id="LC830" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L831" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="831"></td> <td id="LC831" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir")</span></td> </tr> <tr> <td id="L832" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="832"></td> <td id="LC832" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.each {|x| puts "Got #{x}" }</span></td> </tr> <tr> <td id="L833" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="833"></td> <td id="LC833" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L834" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="834"></td> <td id="LC834" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <em>produces:</em></span></td> </tr> <tr> <td id="L835" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="835"></td> <td id="LC835" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L836" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="836"></td> <td id="LC836" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got .</span></td> </tr> <tr> <td id="L837" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="837"></td> <td id="LC837" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got ..</span></td> </tr> <tr> <td id="L838" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="838"></td> <td id="LC838" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got config.h</span></td> </tr> <tr> <td id="L839" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="839"></td> <td id="LC839" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got main.rb</span></td> </tr> <tr> <td id="L840" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="840"></td> <td id="LC840" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L841" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="841"></td> <td id="LC841" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L842" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="842"></td> <td id="LC842" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_each</span>(VALUE dir)</td> </tr> <tr> <td id="L843" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="843"></td> <td id="LC843" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L844" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="844"></td> <td id="LC844" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN_ENUMERATOR</span>(dir, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L845" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="845"></td> <td id="LC845" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">dir_each_entry</span>(dir, dir_yield, Qnil, <span class="pl-c1">FALSE</span>);</td> </tr> <tr> <td id="L846" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="846"></td> <td id="LC846" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L847" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="847"></td> <td id="LC847" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L848" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="848"></td> <td id="LC848" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L849" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="849"></td> <td id="LC849" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_each_entry</span>(VALUE dir, VALUE (*each)(VALUE, VALUE), VALUE arg, int children_only)</td> </tr> <tr> <td id="L850" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="850"></td> <td id="LC850" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L851" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="851"></td> <td id="LC851" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L852" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="852"></td> <td id="LC852" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dirent *dp;</td> </tr> <tr> <td id="L853" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="853"></td> <td id="LC853" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(<span class="pl-k">int</span> norm_p);</td> </tr> <tr> <td id="L854" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="854"></td> <td id="LC854" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L855" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="855"></td> <td id="LC855" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GetDIR</span>(dir, dirp);</td> </tr> <tr> <td id="L856" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="856"></td> <td id="LC856" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rewinddir</span>(dirp-><span class="pl-smi">dir</span>);</td> </tr> <tr> <td id="L857" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="857"></td> <td id="LC857" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(norm_p = <span class="pl-c1">need_normalization</span>(dirp-><span class="pl-smi">dir</span>, <span class="pl-c1">RSTRING_PTR</span>(dirp-><span class="pl-smi">path</span>)));</td> </tr> <tr> <td id="L858" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="858"></td> <td id="LC858" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> ((dp = <span class="pl-c1">READDIR</span>(dirp-><span class="pl-smi">dir</span>, dirp-><span class="pl-smi">enc</span>)) != <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L859" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="859"></td> <td id="LC859" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *name = dp-><span class="pl-smi">d_name</span>;</td> </tr> <tr> <td id="L860" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="860"></td> <td id="LC860" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> namlen = <span class="pl-c1">NAMLEN</span>(dp);</td> </tr> <tr> <td id="L861" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="861"></td> <td id="LC861" class="blob-code blob-code-inner js-file-line"> VALUE path;</td> </tr> <tr> <td id="L862" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="862"></td> <td id="LC862" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L863" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="863"></td> <td id="LC863" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (children_only && name[<span class="pl-c1">0</span>] == <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L864" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="864"></td> <td id="LC864" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (namlen == <span class="pl-c1">1</span>) <span class="pl-k">continue</span>; <span class="pl-c"><span class="pl-c">/*</span> current directory <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L865" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="865"></td> <td id="LC865" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (namlen == <span class="pl-c1">2</span> && name[<span class="pl-c1">1</span>] == <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) <span class="pl-k">continue</span>; <span class="pl-c"><span class="pl-c">/*</span> parent directory <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L866" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="866"></td> <td id="LC866" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L867" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="867"></td> <td id="LC867" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> NORMALIZE_UTF8PATH</td> </tr> <tr> <td id="L868" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="868"></td> <td id="LC868" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (norm_p && <span class="pl-c1">has_nonascii</span>(name, namlen) &&</td> </tr> <tr> <td id="L869" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="869"></td> <td id="LC869" class="blob-code blob-code-inner js-file-line"> !<span class="pl-c1">NIL_P</span>(path = <span class="pl-c1">rb_str_normalize_ospath</span>(name, namlen))) {</td> </tr> <tr> <td id="L870" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="870"></td> <td id="LC870" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">rb_external_str_with_enc</span>(path, dirp-><span class="pl-smi">enc</span>);</td> </tr> <tr> <td id="L871" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="871"></td> <td id="LC871" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L872" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="872"></td> <td id="LC872" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L873" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="873"></td> <td id="LC873" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L874" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="874"></td> <td id="LC874" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">rb_external_str_new_with_enc</span>(name, namlen, dirp-><span class="pl-smi">enc</span>);</td> </tr> <tr> <td id="L875" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="875"></td> <td id="LC875" class="blob-code blob-code-inner js-file-line"> (*each)(arg, path);</td> </tr> <tr> <td id="L876" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="876"></td> <td id="LC876" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L877" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="877"></td> <td id="LC877" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dir;</td> </tr> <tr> <td id="L878" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="878"></td> <td id="LC878" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L879" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="879"></td> <td id="LC879" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L880" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="880"></td> <td id="LC880" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_TELLDIR</td> </tr> <tr> <td id="L881" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="881"></td> <td id="LC881" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L882" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="882"></td> <td id="LC882" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L883" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="883"></td> <td id="LC883" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.pos -> integer</span></td> </tr> <tr> <td id="L884" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="884"></td> <td id="LC884" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.tell -> integer</span></td> </tr> <tr> <td id="L885" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="885"></td> <td id="LC885" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L886" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="886"></td> <td id="LC886" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns the current position in <em>dir</em>. See also Dir#seek.</span></td> </tr> <tr> <td id="L887" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="887"></td> <td id="LC887" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L888" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="888"></td> <td id="LC888" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir")</span></td> </tr> <tr> <td id="L889" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="889"></td> <td id="LC889" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.tell #=> 0</span></td> </tr> <tr> <td id="L890" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="890"></td> <td id="LC890" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> "."</span></td> </tr> <tr> <td id="L891" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="891"></td> <td id="LC891" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.tell #=> 12</span></td> </tr> <tr> <td id="L892" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="892"></td> <td id="LC892" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L893" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="893"></td> <td id="LC893" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L894" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="894"></td> <td id="LC894" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_tell</span>(VALUE dir)</td> </tr> <tr> <td id="L895" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="895"></td> <td id="LC895" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L896" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="896"></td> <td id="LC896" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L897" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="897"></td> <td id="LC897" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> pos;</td> </tr> <tr> <td id="L898" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="898"></td> <td id="LC898" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L899" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="899"></td> <td id="LC899" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GetDIR</span>(dir, dirp);</td> </tr> <tr> <td id="L900" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="900"></td> <td id="LC900" class="blob-code blob-code-inner js-file-line"> pos = <span class="pl-c1">telldir</span>(dirp-><span class="pl-smi">dir</span>);</td> </tr> <tr> <td id="L901" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="901"></td> <td id="LC901" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_int2inum</span>(pos);</td> </tr> <tr> <td id="L902" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="902"></td> <td id="LC902" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L903" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="903"></td> <td id="LC903" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L904" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="904"></td> <td id="LC904" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">dir_tell</span> rb_f_notimplement</td> </tr> <tr> <td id="L905" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="905"></td> <td id="LC905" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L906" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="906"></td> <td id="LC906" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L907" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="907"></td> <td id="LC907" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_SEEKDIR</td> </tr> <tr> <td id="L908" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="908"></td> <td id="LC908" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L909" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="909"></td> <td id="LC909" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L910" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="910"></td> <td id="LC910" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.seek( integer ) -> dir</span></td> </tr> <tr> <td id="L911" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="911"></td> <td id="LC911" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L912" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="912"></td> <td id="LC912" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Seeks to a particular location in <em>dir</em>. <i>integer</i></span></td> </tr> <tr> <td id="L913" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="913"></td> <td id="LC913" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * must be a value returned by Dir#tell.</span></td> </tr> <tr> <td id="L914" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="914"></td> <td id="LC914" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L915" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="915"></td> <td id="LC915" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir") #=> #<Dir:0x401b3c40></span></td> </tr> <tr> <td id="L916" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="916"></td> <td id="LC916" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> "."</span></td> </tr> <tr> <td id="L917" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="917"></td> <td id="LC917" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * i = d.tell #=> 12</span></td> </tr> <tr> <td id="L918" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="918"></td> <td id="LC918" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> ".."</span></td> </tr> <tr> <td id="L919" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="919"></td> <td id="LC919" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.seek(i) #=> #<Dir:0x401b3c40></span></td> </tr> <tr> <td id="L920" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="920"></td> <td id="LC920" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> ".."</span></td> </tr> <tr> <td id="L921" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="921"></td> <td id="LC921" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L922" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="922"></td> <td id="LC922" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L923" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="923"></td> <td id="LC923" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_seek</span>(VALUE dir, VALUE pos)</td> </tr> <tr> <td id="L924" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="924"></td> <td id="LC924" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L925" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="925"></td> <td id="LC925" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L926" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="926"></td> <td id="LC926" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> p = <span class="pl-c1">NUM2LONG</span>(pos);</td> </tr> <tr> <td id="L927" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="927"></td> <td id="LC927" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L928" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="928"></td> <td id="LC928" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GetDIR</span>(dir, dirp);</td> </tr> <tr> <td id="L929" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="929"></td> <td id="LC929" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">seekdir</span>(dirp-><span class="pl-smi">dir</span>, p);</td> </tr> <tr> <td id="L930" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="930"></td> <td id="LC930" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dir;</td> </tr> <tr> <td id="L931" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="931"></td> <td id="LC931" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L932" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="932"></td> <td id="LC932" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L933" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="933"></td> <td id="LC933" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">dir_seek</span> rb_f_notimplement</td> </tr> <tr> <td id="L934" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="934"></td> <td id="LC934" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L935" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="935"></td> <td id="LC935" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L936" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="936"></td> <td id="LC936" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_SEEKDIR</td> </tr> <tr> <td id="L937" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="937"></td> <td id="LC937" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L938" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="938"></td> <td id="LC938" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L939" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="939"></td> <td id="LC939" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.pos = integer -> integer</span></td> </tr> <tr> <td id="L940" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="940"></td> <td id="LC940" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L941" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="941"></td> <td id="LC941" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Synonym for Dir#seek, but returns the position parameter.</span></td> </tr> <tr> <td id="L942" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="942"></td> <td id="LC942" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L943" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="943"></td> <td id="LC943" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir") #=> #<Dir:0x401b3c40></span></td> </tr> <tr> <td id="L944" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="944"></td> <td id="LC944" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> "."</span></td> </tr> <tr> <td id="L945" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="945"></td> <td id="LC945" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * i = d.pos #=> 12</span></td> </tr> <tr> <td id="L946" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="946"></td> <td id="LC946" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> ".."</span></td> </tr> <tr> <td id="L947" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="947"></td> <td id="LC947" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.pos = i #=> 12</span></td> </tr> <tr> <td id="L948" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="948"></td> <td id="LC948" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> ".."</span></td> </tr> <tr> <td id="L949" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="949"></td> <td id="LC949" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L950" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="950"></td> <td id="LC950" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L951" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="951"></td> <td id="LC951" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_set_pos</span>(VALUE dir, VALUE pos)</td> </tr> <tr> <td id="L952" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="952"></td> <td id="LC952" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L953" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="953"></td> <td id="LC953" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_seek</span>(dir, pos);</td> </tr> <tr> <td id="L954" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="954"></td> <td id="LC954" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> pos;</td> </tr> <tr> <td id="L955" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="955"></td> <td id="LC955" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L956" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="956"></td> <td id="LC956" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L957" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="957"></td> <td id="LC957" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">dir_set_pos</span> rb_f_notimplement</td> </tr> <tr> <td id="L958" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="958"></td> <td id="LC958" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L959" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="959"></td> <td id="LC959" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L960" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="960"></td> <td id="LC960" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L961" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="961"></td> <td id="LC961" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L962" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="962"></td> <td id="LC962" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.rewind -> dir</span></td> </tr> <tr> <td id="L963" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="963"></td> <td id="LC963" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L964" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="964"></td> <td id="LC964" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Repositions <em>dir</em> to the first entry.</span></td> </tr> <tr> <td id="L965" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="965"></td> <td id="LC965" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L966" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="966"></td> <td id="LC966" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir")</span></td> </tr> <tr> <td id="L967" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="967"></td> <td id="LC967" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> "."</span></td> </tr> <tr> <td id="L968" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="968"></td> <td id="LC968" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.rewind #=> #<Dir:0x401b3fb0></span></td> </tr> <tr> <td id="L969" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="969"></td> <td id="LC969" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.read #=> "."</span></td> </tr> <tr> <td id="L970" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="970"></td> <td id="LC970" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L971" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="971"></td> <td id="LC971" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L972" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="972"></td> <td id="LC972" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_rewind</span>(VALUE dir)</td> </tr> <tr> <td id="L973" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="973"></td> <td id="LC973" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L974" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="974"></td> <td id="LC974" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L975" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="975"></td> <td id="LC975" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L976" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="976"></td> <td id="LC976" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GetDIR</span>(dir, dirp);</td> </tr> <tr> <td id="L977" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="977"></td> <td id="LC977" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rewinddir</span>(dirp-><span class="pl-smi">dir</span>);</td> </tr> <tr> <td id="L978" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="978"></td> <td id="LC978" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dir;</td> </tr> <tr> <td id="L979" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="979"></td> <td id="LC979" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L980" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="980"></td> <td id="LC980" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L981" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="981"></td> <td id="LC981" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L982" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="982"></td> <td id="LC982" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L983" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="983"></td> <td id="LC983" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.close -> nil</span></td> </tr> <tr> <td id="L984" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="984"></td> <td id="LC984" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L985" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="985"></td> <td id="LC985" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Closes the directory stream.</span></td> </tr> <tr> <td id="L986" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="986"></td> <td id="LC986" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Calling this method on closed Dir object is ignored since Ruby 2.3.</span></td> </tr> <tr> <td id="L987" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="987"></td> <td id="LC987" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L988" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="988"></td> <td id="LC988" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir")</span></td> </tr> <tr> <td id="L989" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="989"></td> <td id="LC989" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.close #=> nil</span></td> </tr> <tr> <td id="L990" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="990"></td> <td id="LC990" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L991" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="991"></td> <td id="LC991" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L992" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="992"></td> <td id="LC992" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_close</span>(VALUE dir)</td> </tr> <tr> <td id="L993" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="993"></td> <td id="LC993" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L994" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="994"></td> <td id="LC994" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp;</td> </tr> <tr> <td id="L995" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="995"></td> <td id="LC995" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L996" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="996"></td> <td id="LC996" class="blob-code blob-code-inner js-file-line"> dirp = <span class="pl-c1">dir_get</span>(dir);</td> </tr> <tr> <td id="L997" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="997"></td> <td id="LC997" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dirp-><span class="pl-smi">dir</span>) <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L998" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="998"></td> <td id="LC998" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">closedir</span>(dirp-><span class="pl-smi">dir</span>);</td> </tr> <tr> <td id="L999" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="999"></td> <td id="LC999" class="blob-code blob-code-inner js-file-line"> dirp-><span class="pl-smi">dir</span> = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L1000" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1000"></td> <td id="LC1000" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1001" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1001"></td> <td id="LC1001" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L1002" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1002"></td> <td id="LC1002" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1003" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1003"></td> <td id="LC1003" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1004" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1004"></td> <td id="LC1004" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1005" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1005"></td> <td id="LC1005" class="blob-code blob-code-inner js-file-line"><span class="pl-en">nogvl_chdir</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L1006" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1006"></td> <td id="LC1006" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1007" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1007"></td> <td id="LC1007" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path = ptr;</td> </tr> <tr> <td id="L1008" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1008"></td> <td id="LC1008" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1009" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1009"></td> <td id="LC1009" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)(VALUE)<span class="pl-c1">chdir</span>(path);</td> </tr> <tr> <td id="L1010" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1010"></td> <td id="LC1010" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1011" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1011"></td> <td id="LC1011" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1012" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1012"></td> <td id="LC1012" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L1013" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1013"></td> <td id="LC1013" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_chdir0</span>(VALUE path)</td> </tr> <tr> <td id="L1014" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1014"></td> <td id="LC1014" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1015" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1015"></td> <td id="LC1015" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">chdir</span>(<span class="pl-c1">RSTRING_PTR</span>(path)) < <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1016" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1016"></td> <td id="LC1016" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(path);</td> </tr> <tr> <td id="L1017" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1017"></td> <td id="LC1017" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1018" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1018"></td> <td id="LC1018" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1019" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1019"></td> <td id="LC1019" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span> chdir_blocking = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1020" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1020"></td> <td id="LC1020" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE chdir_thread = Qnil;</td> </tr> <tr> <td id="L1021" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1021"></td> <td id="LC1021" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1022" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1022"></td> <td id="LC1022" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> chdir_data {</td> </tr> <tr> <td id="L1023" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1023"></td> <td id="LC1023" class="blob-code blob-code-inner js-file-line"> VALUE old_path, new_path;</td> </tr> <tr> <td id="L1024" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1024"></td> <td id="LC1024" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> done;</td> </tr> <tr> <td id="L1025" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1025"></td> <td id="LC1025" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L1026" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1026"></td> <td id="LC1026" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1027" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1027"></td> <td id="LC1027" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1028" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1028"></td> <td id="LC1028" class="blob-code blob-code-inner js-file-line"><span class="pl-en">chdir_yield</span>(VALUE v)</td> </tr> <tr> <td id="L1029" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1029"></td> <td id="LC1029" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1030" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1030"></td> <td id="LC1030" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> chdir_data *args = (<span class="pl-k">void</span> *)v;</td> </tr> <tr> <td id="L1031" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1031"></td> <td id="LC1031" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_chdir0</span>(args-><span class="pl-smi">new_path</span>);</td> </tr> <tr> <td id="L1032" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1032"></td> <td id="LC1032" class="blob-code blob-code-inner js-file-line"> args-><span class="pl-smi">done</span> = <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L1033" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1033"></td> <td id="LC1033" class="blob-code blob-code-inner js-file-line"> chdir_blocking++;</td> </tr> <tr> <td id="L1034" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1034"></td> <td id="LC1034" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">NIL_P</span>(chdir_thread))</td> </tr> <tr> <td id="L1035" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1035"></td> <td id="LC1035" class="blob-code blob-code-inner js-file-line"> chdir_thread = <span class="pl-c1">rb_thread_current</span>();</td> </tr> <tr> <td id="L1036" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1036"></td> <td id="LC1036" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_yield</span>(args-><span class="pl-smi">new_path</span>);</td> </tr> <tr> <td id="L1037" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1037"></td> <td id="LC1037" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1038" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1038"></td> <td id="LC1038" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1039" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1039"></td> <td id="LC1039" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1040" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1040"></td> <td id="LC1040" class="blob-code blob-code-inner js-file-line"><span class="pl-en">chdir_restore</span>(VALUE v)</td> </tr> <tr> <td id="L1041" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1041"></td> <td id="LC1041" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1042" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1042"></td> <td id="LC1042" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> chdir_data *args = (<span class="pl-k">void</span> *)v;</td> </tr> <tr> <td id="L1043" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1043"></td> <td id="LC1043" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (args-><span class="pl-smi">done</span>) {</td> </tr> <tr> <td id="L1044" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1044"></td> <td id="LC1044" class="blob-code blob-code-inner js-file-line"> chdir_blocking--;</td> </tr> <tr> <td id="L1045" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1045"></td> <td id="LC1045" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (chdir_blocking == <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1046" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1046"></td> <td id="LC1046" class="blob-code blob-code-inner js-file-line"> chdir_thread = Qnil;</td> </tr> <tr> <td id="L1047" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1047"></td> <td id="LC1047" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_chdir0</span>(args-><span class="pl-smi">old_path</span>);</td> </tr> <tr> <td id="L1048" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1048"></td> <td id="LC1048" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1049" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1049"></td> <td id="LC1049" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L1050" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1050"></td> <td id="LC1050" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1051" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1051"></td> <td id="LC1051" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1052" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1052"></td> <td id="LC1052" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1053" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1053"></td> <td id="LC1053" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L1054" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1054"></td> <td id="LC1054" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.chdir( [ string] ) -> 0</span></td> </tr> <tr> <td id="L1055" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1055"></td> <td id="LC1055" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.chdir( [ string] ) {| path | block } -> anObject</span></td> </tr> <tr> <td id="L1056" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1056"></td> <td id="LC1056" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1057" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1057"></td> <td id="LC1057" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Changes the current working directory of the process to the given</span></td> </tr> <tr> <td id="L1058" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1058"></td> <td id="LC1058" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * string. When called without an argument, changes the directory to</span></td> </tr> <tr> <td id="L1059" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1059"></td> <td id="LC1059" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * the value of the environment variable <code>HOME</code>, or</span></td> </tr> <tr> <td id="L1060" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1060"></td> <td id="LC1060" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <code>LOGDIR</code>. SystemCallError (probably Errno::ENOENT) if</span></td> </tr> <tr> <td id="L1061" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1061"></td> <td id="LC1061" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * the target directory does not exist.</span></td> </tr> <tr> <td id="L1062" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1062"></td> <td id="LC1062" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1063" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1063"></td> <td id="LC1063" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * If a block is given, it is passed the name of the new current</span></td> </tr> <tr> <td id="L1064" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1064"></td> <td id="LC1064" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory, and the block is executed with that as the current</span></td> </tr> <tr> <td id="L1065" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1065"></td> <td id="LC1065" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory. The original working directory is restored when the block</span></td> </tr> <tr> <td id="L1066" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1066"></td> <td id="LC1066" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * exits. The return value of <code>chdir</code> is the value of the</span></td> </tr> <tr> <td id="L1067" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1067"></td> <td id="LC1067" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * block. <code>chdir</code> blocks can be nested, but in a</span></td> </tr> <tr> <td id="L1068" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1068"></td> <td id="LC1068" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * multi-threaded program an error will be raised if a thread attempts</span></td> </tr> <tr> <td id="L1069" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1069"></td> <td id="LC1069" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * to open a <code>chdir</code> block while another thread has one</span></td> </tr> <tr> <td id="L1070" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1070"></td> <td id="LC1070" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * open or a call to <code>chdir</code> without a block occurs inside</span></td> </tr> <tr> <td id="L1071" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1071"></td> <td id="LC1071" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * a block passed to <code>chdir</code> (even in the same thread).</span></td> </tr> <tr> <td id="L1072" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1072"></td> <td id="LC1072" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1073" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1073"></td> <td id="LC1073" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.chdir("/var/spool/mail")</span></td> </tr> <tr> <td id="L1074" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1074"></td> <td id="LC1074" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1075" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1075"></td> <td id="LC1075" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.chdir("/tmp") do</span></td> </tr> <tr> <td id="L1076" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1076"></td> <td id="LC1076" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1077" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1077"></td> <td id="LC1077" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.chdir("/usr") do</span></td> </tr> <tr> <td id="L1078" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1078"></td> <td id="LC1078" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1079" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1079"></td> <td id="LC1079" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * end</span></td> </tr> <tr> <td id="L1080" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1080"></td> <td id="LC1080" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1081" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1081"></td> <td id="LC1081" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * end</span></td> </tr> <tr> <td id="L1082" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1082"></td> <td id="LC1082" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1083" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1083"></td> <td id="LC1083" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1084" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1084"></td> <td id="LC1084" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <em>produces:</em></span></td> </tr> <tr> <td id="L1085" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1085"></td> <td id="LC1085" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1086" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1086"></td> <td id="LC1086" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /var/spool/mail</span></td> </tr> <tr> <td id="L1087" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1087"></td> <td id="LC1087" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /tmp</span></td> </tr> <tr> <td id="L1088" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1088"></td> <td id="LC1088" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /usr</span></td> </tr> <tr> <td id="L1089" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1089"></td> <td id="LC1089" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /tmp</span></td> </tr> <tr> <td id="L1090" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1090"></td> <td id="LC1090" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /var/spool/mail</span></td> </tr> <tr> <td id="L1091" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1091"></td> <td id="LC1091" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1092" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1092"></td> <td id="LC1092" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1093" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1093"></td> <td id="LC1093" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_chdir</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE obj)</td> </tr> <tr> <td id="L1094" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1094"></td> <td id="LC1094" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1095" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1095"></td> <td id="LC1095" class="blob-code blob-code-inner js-file-line"> VALUE path = Qnil;</td> </tr> <tr> <td id="L1096" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1096"></td> <td id="LC1096" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1097" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1097"></td> <td id="LC1097" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_check_arity</span>(argc, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>) == <span class="pl-c1">1</span>) {</td> </tr> <tr> <td id="L1098" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1098"></td> <td id="LC1098" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">rb_str_encode_ospath</span>(<span class="pl-c1">rb_get_path</span>(argv[<span class="pl-c1">0</span>]));</td> </tr> <tr> <td id="L1099" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1099"></td> <td id="LC1099" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1100" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1100"></td> <td id="LC1100" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1101" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1101"></td> <td id="LC1101" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *dist = <span class="pl-c1">getenv</span>(<span class="pl-s"><span class="pl-pds">"</span>HOME<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1102" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1102"></td> <td id="LC1102" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dist) {</td> </tr> <tr> <td id="L1103" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1103"></td> <td id="LC1103" class="blob-code blob-code-inner js-file-line"> dist = <span class="pl-c1">getenv</span>(<span class="pl-s"><span class="pl-pds">"</span>LOGDIR<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1104" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1104"></td> <td id="LC1104" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dist) <span class="pl-c1">rb_raise</span>(rb_eArgError, <span class="pl-s"><span class="pl-pds">"</span>HOME/LOGDIR not set<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1105" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1105"></td> <td id="LC1105" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1106" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1106"></td> <td id="LC1106" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">rb_str_new2</span>(dist);</td> </tr> <tr> <td id="L1107" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1107"></td> <td id="LC1107" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1108" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1108"></td> <td id="LC1108" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1109" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1109"></td> <td id="LC1109" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (chdir_blocking > <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L1110" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1110"></td> <td id="LC1110" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_thread_current</span>() != chdir_thread)</td> </tr> <tr> <td id="L1111" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1111"></td> <td id="LC1111" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_raise</span>(rb_eRuntimeError, <span class="pl-s"><span class="pl-pds">"</span>conflicting chdir during another chdir block<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1112" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1112"></td> <td id="LC1112" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">rb_block_given_p</span>())</td> </tr> <tr> <td id="L1113" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1113"></td> <td id="LC1113" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_warn</span>(<span class="pl-s"><span class="pl-pds">"</span>conflicting chdir during another chdir block<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1114" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1114"></td> <td id="LC1114" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1115" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1115"></td> <td id="LC1115" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1116" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1116"></td> <td id="LC1116" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_block_given_p</span>()) {</td> </tr> <tr> <td id="L1117" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1117"></td> <td id="LC1117" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> chdir_data args;</td> </tr> <tr> <td id="L1118" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1118"></td> <td id="LC1118" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1119" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1119"></td> <td id="LC1119" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">old_path</span> = <span class="pl-c1">rb_str_encode_ospath</span>(<span class="pl-c1">rb_dir_getwd</span>());</td> </tr> <tr> <td id="L1120" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1120"></td> <td id="LC1120" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">new_path</span> = path;</td> </tr> <tr> <td id="L1121" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1121"></td> <td id="LC1121" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">done</span> = <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L1122" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1122"></td> <td id="LC1122" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_ensure</span>(chdir_yield, (VALUE)&args, chdir_restore, (VALUE)&args);</td> </tr> <tr> <td id="L1123" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1123"></td> <td id="LC1123" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1124" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1124"></td> <td id="LC1124" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1125" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1125"></td> <td id="LC1125" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *p = <span class="pl-c1">RSTRING_PTR</span>(path);</td> </tr> <tr> <td id="L1126" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1126"></td> <td id="LC1126" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> r = (<span class="pl-k">int</span>)(VALUE)<span class="pl-c1">rb_thread_call_without_gvl</span>(nogvl_chdir, p,</td> </tr> <tr> <td id="L1127" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1127"></td> <td id="LC1127" class="blob-code blob-code-inner js-file-line"> RUBY_UBF_IO, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1128" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1128"></td> <td id="LC1128" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (r < <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1129" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1129"></td> <td id="LC1129" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(path);</td> </tr> <tr> <td id="L1130" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1130"></td> <td id="LC1130" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1131" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1131"></td> <td id="LC1131" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1132" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1132"></td> <td id="LC1132" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">INT2FIX</span>(<span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1133" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1133"></td> <td id="LC1133" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1134" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1134"></td> <td id="LC1134" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1135" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1135"></td> <td id="LC1135" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined(HAVE_FCHDIR) && defined(HAVE_DIRFD) && HAVE_FCHDIR && HAVE_DIRFD</td> </tr> <tr> <td id="L1136" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1136"></td> <td id="LC1136" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1137" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1137"></td> <td id="LC1137" class="blob-code blob-code-inner js-file-line"><span class="pl-en">nogvl_fchdir</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L1138" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1138"></td> <td id="LC1138" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1139" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1139"></td> <td id="LC1139" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> *fd = ptr;</td> </tr> <tr> <td id="L1140" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1140"></td> <td id="LC1140" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1141" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1141"></td> <td id="LC1141" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)(VALUE)<span class="pl-c1">fchdir</span>(*fd);</td> </tr> <tr> <td id="L1142" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1142"></td> <td id="LC1142" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1143" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1143"></td> <td id="LC1143" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1144" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1144"></td> <td id="LC1144" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L1145" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1145"></td> <td id="LC1145" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_fchdir</span>(<span class="pl-k">int</span> fd)</td> </tr> <tr> <td id="L1146" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1146"></td> <td id="LC1146" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1147" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1147"></td> <td id="LC1147" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">fchdir</span>(fd) < <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1148" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1148"></td> <td id="LC1148" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail</span>(<span class="pl-s"><span class="pl-pds">"</span>fchdir<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1149" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1149"></td> <td id="LC1149" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1150" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1150"></td> <td id="LC1150" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1151" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1151"></td> <td id="LC1151" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> fchdir_data {</td> </tr> <tr> <td id="L1152" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1152"></td> <td id="LC1152" class="blob-code blob-code-inner js-file-line"> VALUE old_dir;</td> </tr> <tr> <td id="L1153" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1153"></td> <td id="LC1153" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd;</td> </tr> <tr> <td id="L1154" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1154"></td> <td id="LC1154" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> done;</td> </tr> <tr> <td id="L1155" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1155"></td> <td id="LC1155" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L1156" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1156"></td> <td id="LC1156" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1157" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1157"></td> <td id="LC1157" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1158" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1158"></td> <td id="LC1158" class="blob-code blob-code-inner js-file-line"><span class="pl-en">fchdir_yield</span>(VALUE v)</td> </tr> <tr> <td id="L1159" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1159"></td> <td id="LC1159" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1160" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1160"></td> <td id="LC1160" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> fchdir_data *args = (<span class="pl-k">void</span> *)v;</td> </tr> <tr> <td id="L1161" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1161"></td> <td id="LC1161" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_fchdir</span>(args-><span class="pl-smi">fd</span>);</td> </tr> <tr> <td id="L1162" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1162"></td> <td id="LC1162" class="blob-code blob-code-inner js-file-line"> args-><span class="pl-smi">done</span> = <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L1163" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1163"></td> <td id="LC1163" class="blob-code blob-code-inner js-file-line"> chdir_blocking++;</td> </tr> <tr> <td id="L1164" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1164"></td> <td id="LC1164" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">NIL_P</span>(chdir_thread))</td> </tr> <tr> <td id="L1165" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1165"></td> <td id="LC1165" class="blob-code blob-code-inner js-file-line"> chdir_thread = <span class="pl-c1">rb_thread_current</span>();</td> </tr> <tr> <td id="L1166" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1166"></td> <td id="LC1166" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_yield_values</span>(<span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1167" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1167"></td> <td id="LC1167" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1168" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1168"></td> <td id="LC1168" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1169" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1169"></td> <td id="LC1169" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1170" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1170"></td> <td id="LC1170" class="blob-code blob-code-inner js-file-line"><span class="pl-en">fchdir_restore</span>(VALUE v)</td> </tr> <tr> <td id="L1171" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1171"></td> <td id="LC1171" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1172" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1172"></td> <td id="LC1172" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> fchdir_data *args = (<span class="pl-k">void</span> *)v;</td> </tr> <tr> <td id="L1173" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1173"></td> <td id="LC1173" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (args-><span class="pl-smi">done</span>) {</td> </tr> <tr> <td id="L1174" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1174"></td> <td id="LC1174" class="blob-code blob-code-inner js-file-line"> chdir_blocking--;</td> </tr> <tr> <td id="L1175" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1175"></td> <td id="LC1175" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (chdir_blocking == <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1176" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1176"></td> <td id="LC1176" class="blob-code blob-code-inner js-file-line"> chdir_thread = Qnil;</td> </tr> <tr> <td id="L1177" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1177"></td> <td id="LC1177" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_fchdir</span>(<span class="pl-c1">RB_NUM2INT</span>(<span class="pl-c1">dir_fileno</span>(args-><span class="pl-smi">old_dir</span>)));</td> </tr> <tr> <td id="L1178" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1178"></td> <td id="LC1178" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1179" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1179"></td> <td id="LC1179" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_close</span>(args-><span class="pl-smi">old_dir</span>);</td> </tr> <tr> <td id="L1180" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1180"></td> <td id="LC1180" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L1181" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1181"></td> <td id="LC1181" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1182" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1182"></td> <td id="LC1182" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1183" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1183"></td> <td id="LC1183" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1184" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1184"></td> <td id="LC1184" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L1185" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1185"></td> <td id="LC1185" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.fchdir( integer ) -> 0</span></td> </tr> <tr> <td id="L1186" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1186"></td> <td id="LC1186" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.fchdir( integer ) { block } -> anObject</span></td> </tr> <tr> <td id="L1187" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1187"></td> <td id="LC1187" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1188" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1188"></td> <td id="LC1188" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Changes the current working directory of the process to the directory</span></td> </tr> <tr> <td id="L1189" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1189"></td> <td id="LC1189" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * specified by the given file descriptor integer. If the file descriptor</span></td> </tr> <tr> <td id="L1190" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1190"></td> <td id="LC1190" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * is not valid, raises SystemCallError. One reason to use</span></td> </tr> <tr> <td id="L1191" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1191"></td> <td id="LC1191" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <code>fchdir</code> instead of <code>chdir</code> is when passing</span></td> </tr> <tr> <td id="L1192" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1192"></td> <td id="LC1192" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory file descriptors over a UNIX socket or to child processes,</span></td> </tr> <tr> <td id="L1193" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1193"></td> <td id="LC1193" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * to avoid TOCTOU (time-of-check to time-of-use) vulnerabilities.</span></td> </tr> <tr> <td id="L1194" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1194"></td> <td id="LC1194" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1195" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1195"></td> <td id="LC1195" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * If a block is given, the current working directory is changed for the</span></td> </tr> <tr> <td id="L1196" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1196"></td> <td id="LC1196" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * duration of the block, and the original working directory is restored</span></td> </tr> <tr> <td id="L1197" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1197"></td> <td id="LC1197" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * when the block exits. The return value of <code>fchdir</code> is the</span></td> </tr> <tr> <td id="L1198" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1198"></td> <td id="LC1198" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * value of the block. <code>fchdir</code> and <code>chdir</code> blocks</span></td> </tr> <tr> <td id="L1199" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1199"></td> <td id="LC1199" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * can be nested, but in a multi-threaded program an error will be raised</span></td> </tr> <tr> <td id="L1200" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1200"></td> <td id="LC1200" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * if a thread attempts to open a <code>fchdir</code> or <code>chdir</code></span></td> </tr> <tr> <td id="L1201" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1201"></td> <td id="LC1201" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * block while another thread has one open or a call to <code>fchdir</code></span></td> </tr> <tr> <td id="L1202" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1202"></td> <td id="LC1202" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * or <code>chdir</code> without a block occurs inside a block passed to</span></td> </tr> <tr> <td id="L1203" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1203"></td> <td id="LC1203" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <code>fchdir</code> or <code>chdir</code> (even in the same thread).</span></td> </tr> <tr> <td id="L1204" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1204"></td> <td id="LC1204" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1205" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1205"></td> <td id="LC1205" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * When generating directory file descriptors from a +Dir+ instance,</span></td> </tr> <tr> <td id="L1206" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1206"></td> <td id="LC1206" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * make sure the +Dir+ instance is not garbage collected before the</span></td> </tr> <tr> <td id="L1207" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1207"></td> <td id="LC1207" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory file descriptor is passed to another process. Otherwise,</span></td> </tr> <tr> <td id="L1208" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1208"></td> <td id="LC1208" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * the directory file descriptor will be closed before it is passed.</span></td> </tr> <tr> <td id="L1209" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1209"></td> <td id="LC1209" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1210" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1210"></td> <td id="LC1210" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir = Dir.new("/var/spool/mail")</span></td> </tr> <tr> <td id="L1211" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1211"></td> <td id="LC1211" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir2 = Dir.new("/usr")</span></td> </tr> <tr> <td id="L1212" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1212"></td> <td id="LC1212" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * fd = dir.fileno</span></td> </tr> <tr> <td id="L1213" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1213"></td> <td id="LC1213" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * fd2 = dir2.fileno</span></td> </tr> <tr> <td id="L1214" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1214"></td> <td id="LC1214" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.fchdir(fd) do</span></td> </tr> <tr> <td id="L1215" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1215"></td> <td id="LC1215" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1216" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1216"></td> <td id="LC1216" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.fchdir(fd2) do</span></td> </tr> <tr> <td id="L1217" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1217"></td> <td id="LC1217" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1218" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1218"></td> <td id="LC1218" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * end</span></td> </tr> <tr> <td id="L1219" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1219"></td> <td id="LC1219" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1220" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1220"></td> <td id="LC1220" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * end</span></td> </tr> <tr> <td id="L1221" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1221"></td> <td id="LC1221" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * puts Dir.pwd</span></td> </tr> <tr> <td id="L1222" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1222"></td> <td id="LC1222" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1223" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1223"></td> <td id="LC1223" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <em>produces:</em></span></td> </tr> <tr> <td id="L1224" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1224"></td> <td id="LC1224" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1225" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1225"></td> <td id="LC1225" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /var/spool/mail</span></td> </tr> <tr> <td id="L1226" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1226"></td> <td id="LC1226" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /tmp</span></td> </tr> <tr> <td id="L1227" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1227"></td> <td id="LC1227" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /usr</span></td> </tr> <tr> <td id="L1228" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1228"></td> <td id="LC1228" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /tmp</span></td> </tr> <tr> <td id="L1229" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1229"></td> <td id="LC1229" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * /var/spool/mail</span></td> </tr> <tr> <td id="L1230" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1230"></td> <td id="LC1230" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1231" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1231"></td> <td id="LC1231" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1232" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1232"></td> <td id="LC1232" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_fchdir</span>(VALUE klass, VALUE fd_value)</td> </tr> <tr> <td id="L1233" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1233"></td> <td id="LC1233" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1234" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1234"></td> <td id="LC1234" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd = <span class="pl-c1">RB_NUM2INT</span>(fd_value);</td> </tr> <tr> <td id="L1235" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1235"></td> <td id="LC1235" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1236" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1236"></td> <td id="LC1236" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (chdir_blocking > <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L1237" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1237"></td> <td id="LC1237" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_thread_current</span>() != chdir_thread)</td> </tr> <tr> <td id="L1238" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1238"></td> <td id="LC1238" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_raise</span>(rb_eRuntimeError, <span class="pl-s"><span class="pl-pds">"</span>conflicting chdir during another chdir block<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1239" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1239"></td> <td id="LC1239" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">rb_block_given_p</span>())</td> </tr> <tr> <td id="L1240" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1240"></td> <td id="LC1240" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_warn</span>(<span class="pl-s"><span class="pl-pds">"</span>conflicting chdir during another chdir block<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1241" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1241"></td> <td id="LC1241" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1242" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1242"></td> <td id="LC1242" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1243" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1243"></td> <td id="LC1243" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_block_given_p</span>()) {</td> </tr> <tr> <td id="L1244" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1244"></td> <td id="LC1244" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> fchdir_data args;</td> </tr> <tr> <td id="L1245" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1245"></td> <td id="LC1245" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">old_dir</span> = <span class="pl-c1">dir_s_alloc</span>(klass);</td> </tr> <tr> <td id="L1246" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1246"></td> <td id="LC1246" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_initialize</span>(<span class="pl-c1">NULL</span>, args.<span class="pl-smi">old_dir</span>, <span class="pl-c1">rb_fstring_cstr</span>(<span class="pl-s"><span class="pl-pds">"</span>.<span class="pl-pds">"</span></span>), Qnil);</td> </tr> <tr> <td id="L1247" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1247"></td> <td id="LC1247" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">fd</span> = fd;</td> </tr> <tr> <td id="L1248" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1248"></td> <td id="LC1248" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">done</span> = <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L1249" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1249"></td> <td id="LC1249" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_ensure</span>(fchdir_yield, (VALUE)&args, fchdir_restore, (VALUE)&args);</td> </tr> <tr> <td id="L1250" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1250"></td> <td id="LC1250" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1251" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1251"></td> <td id="LC1251" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1252" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1252"></td> <td id="LC1252" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> r = (<span class="pl-k">int</span>)(VALUE)<span class="pl-c1">rb_thread_call_without_gvl</span>(nogvl_fchdir, &fd,</td> </tr> <tr> <td id="L1253" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1253"></td> <td id="LC1253" class="blob-code blob-code-inner js-file-line"> RUBY_UBF_IO, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1254" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1254"></td> <td id="LC1254" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (r < <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1255" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1255"></td> <td id="LC1255" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail</span>(<span class="pl-s"><span class="pl-pds">"</span>fchdir<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L1256" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1256"></td> <td id="LC1256" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1257" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1257"></td> <td id="LC1257" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1258" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1258"></td> <td id="LC1258" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">INT2FIX</span>(<span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1259" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1259"></td> <td id="LC1259" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1260" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1260"></td> <td id="LC1260" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1261" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1261"></td> <td id="LC1261" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">dir_s_fchdir</span> rb_f_notimplement</td> </tr> <tr> <td id="L1262" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1262"></td> <td id="LC1262" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1263" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1263"></td> <td id="LC1263" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1264" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1264"></td> <td id="LC1264" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1265" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1265"></td> <td id="LC1265" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L1266" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1266"></td> <td id="LC1266" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.chdir -> nil</span></td> </tr> <tr> <td id="L1267" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1267"></td> <td id="LC1267" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1268" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1268"></td> <td id="LC1268" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Changes the current working directory to the receiver.</span></td> </tr> <tr> <td id="L1269" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1269"></td> <td id="LC1269" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1270" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1270"></td> <td id="LC1270" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * # Assume current directory is /path</span></td> </tr> <tr> <td id="L1271" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1271"></td> <td id="LC1271" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.new("testdir").chdir</span></td> </tr> <tr> <td id="L1272" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1272"></td> <td id="LC1272" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.pwd # => '/path/testdir'</span></td> </tr> <tr> <td id="L1273" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1273"></td> <td id="LC1273" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1274" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1274"></td> <td id="LC1274" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1275" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1275"></td> <td id="LC1275" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_chdir</span>(VALUE dir)</td> </tr> <tr> <td id="L1276" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1276"></td> <td id="LC1276" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1277" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1277"></td> <td id="LC1277" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined(HAVE_FCHDIR) && defined(HAVE_DIRFD) && HAVE_FCHDIR && HAVE_DIRFD</td> </tr> <tr> <td id="L1278" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1278"></td> <td id="LC1278" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_s_fchdir</span>(rb_cDir, <span class="pl-c1">dir_fileno</span>(dir));</td> </tr> <tr> <td id="L1279" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1279"></td> <td id="LC1279" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1280" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1280"></td> <td id="LC1280" class="blob-code blob-code-inner js-file-line"> VALUE path = <span class="pl-c1">dir_get</span>(dir)-><span class="pl-smi">path</span>;</td> </tr> <tr> <td id="L1281" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1281"></td> <td id="LC1281" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_s_chdir</span>(<span class="pl-c1">1</span>, &path, rb_cDir);</td> </tr> <tr> <td id="L1282" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1282"></td> <td id="LC1282" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1283" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1283"></td> <td id="LC1283" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1284" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1284"></td> <td id="LC1284" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L1285" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1285"></td> <td id="LC1285" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1286" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1286"></td> <td id="LC1286" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1287" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1287"></td> <td id="LC1287" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> _WIN32</td> </tr> <tr> <td id="L1288" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1288"></td> <td id="LC1288" class="blob-code blob-code-inner js-file-line">VALUE</td> </tr> <tr> <td id="L1289" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1289"></td> <td id="LC1289" class="blob-code blob-code-inner js-file-line"><span class="pl-en">rb_dir_getwd_ospath</span>(<span class="pl-k">void</span>)</td> </tr> <tr> <td id="L1290" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1290"></td> <td id="LC1290" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1291" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1291"></td> <td id="LC1291" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L1292" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1292"></td> <td id="LC1292" class="blob-code blob-code-inner js-file-line"> VALUE cwd;</td> </tr> <tr> <td id="L1293" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1293"></td> <td id="LC1293" class="blob-code blob-code-inner js-file-line"> VALUE path_guard;</td> </tr> <tr> <td id="L1294" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1294"></td> <td id="LC1294" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1295" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1295"></td> <td id="LC1295" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">undef</span> RUBY_UNTYPED_DATA_WARNING</td> </tr> <tr> <td id="L1296" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1296"></td> <td id="LC1296" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">RUBY_UNTYPED_DATA_WARNING</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L1297" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1297"></td> <td id="LC1297" class="blob-code blob-code-inner js-file-line"> path_guard = <span class="pl-c1">Data_Wrap_Struct</span>((VALUE)<span class="pl-c1">0</span>, <span class="pl-c1">NULL</span>, RUBY_DEFAULT_FREE, <span class="pl-c1">NULL</span>);</td> </tr> <tr> <td id="L1298" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1298"></td> <td id="LC1298" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">ruby_getcwd</span>();</td> </tr> <tr> <td id="L1299" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1299"></td> <td id="LC1299" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">DATA_PTR</span>(path_guard) = path;</td> </tr> <tr> <td id="L1300" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1300"></td> <td id="LC1300" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> __APPLE__</td> </tr> <tr> <td id="L1301" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1301"></td> <td id="LC1301" class="blob-code blob-code-inner js-file-line"> cwd = <span class="pl-c1">rb_str_normalize_ospath</span>(path, <span class="pl-c1">strlen</span>(path));</td> </tr> <tr> <td id="L1302" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1302"></td> <td id="LC1302" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1303" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1303"></td> <td id="LC1303" class="blob-code blob-code-inner js-file-line"> cwd = <span class="pl-c1">rb_str_new2</span>(path);</td> </tr> <tr> <td id="L1304" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1304"></td> <td id="LC1304" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1305" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1305"></td> <td id="LC1305" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">DATA_PTR</span>(path_guard) = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1306" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1306"></td> <td id="LC1306" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1307" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1307"></td> <td id="LC1307" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">xfree</span>(path);</td> </tr> <tr> <td id="L1308" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1308"></td> <td id="LC1308" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> cwd;</td> </tr> <tr> <td id="L1309" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1309"></td> <td id="LC1309" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1310" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1310"></td> <td id="LC1310" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1311" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1311"></td> <td id="LC1311" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1312" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1312"></td> <td id="LC1312" class="blob-code blob-code-inner js-file-line">VALUE</td> </tr> <tr> <td id="L1313" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1313"></td> <td id="LC1313" class="blob-code blob-code-inner js-file-line"><span class="pl-en">rb_dir_getwd</span>(<span class="pl-k">void</span>)</td> </tr> <tr> <td id="L1314" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1314"></td> <td id="LC1314" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1315" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1315"></td> <td id="LC1315" class="blob-code blob-code-inner js-file-line"> rb_encoding *fs = <span class="pl-c1">rb_filesystem_encoding</span>();</td> </tr> <tr> <td id="L1316" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1316"></td> <td id="LC1316" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fsenc = <span class="pl-c1">rb_enc_to_index</span>(fs);</td> </tr> <tr> <td id="L1317" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1317"></td> <td id="LC1317" class="blob-code blob-code-inner js-file-line"> VALUE cwd = <span class="pl-c1">rb_dir_getwd_ospath</span>();</td> </tr> <tr> <td id="L1318" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1318"></td> <td id="LC1318" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1319" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1319"></td> <td id="LC1319" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (fsenc) {</td> </tr> <tr> <td id="L1320" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1320"></td> <td id="LC1320" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ENCINDEX_US_ASCII:</td> </tr> <tr> <td id="L1321" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1321"></td> <td id="LC1321" class="blob-code blob-code-inner js-file-line"> fsenc = ENCINDEX_ASCII_8BIT;</td> </tr> <tr> <td id="L1322" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1322"></td> <td id="LC1322" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ENCINDEX_ASCII_8BIT:</td> </tr> <tr> <td id="L1323" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1323"></td> <td id="LC1323" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L1324" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1324"></td> <td id="LC1324" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined _WIN32 || defined __APPLE__</td> </tr> <tr> <td id="L1325" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1325"></td> <td id="LC1325" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L1326" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1326"></td> <td id="LC1326" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_str_conv_enc</span>(cwd, <span class="pl-c1">NULL</span>, fs);</td> </tr> <tr> <td id="L1327" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1327"></td> <td id="LC1327" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1328" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1328"></td> <td id="LC1328" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1329" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1329"></td> <td id="LC1329" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_enc_associate_index</span>(cwd, fsenc);</td> </tr> <tr> <td id="L1330" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1330"></td> <td id="LC1330" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1331" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1331"></td> <td id="LC1331" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1332" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1332"></td> <td id="LC1332" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1333" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1333"></td> <td id="LC1333" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L1334" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1334"></td> <td id="LC1334" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.getwd -> string</span></td> </tr> <tr> <td id="L1335" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1335"></td> <td id="LC1335" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.pwd -> string</span></td> </tr> <tr> <td id="L1336" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1336"></td> <td id="LC1336" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1337" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1337"></td> <td id="LC1337" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns the path to the current working directory of this process as</span></td> </tr> <tr> <td id="L1338" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1338"></td> <td id="LC1338" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * a string.</span></td> </tr> <tr> <td id="L1339" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1339"></td> <td id="LC1339" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1340" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1340"></td> <td id="LC1340" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.chdir("/tmp") #=> 0</span></td> </tr> <tr> <td id="L1341" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1341"></td> <td id="LC1341" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.getwd #=> "/tmp"</span></td> </tr> <tr> <td id="L1342" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1342"></td> <td id="LC1342" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.pwd #=> "/tmp"</span></td> </tr> <tr> <td id="L1343" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1343"></td> <td id="LC1343" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1344" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1344"></td> <td id="LC1344" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1345" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1345"></td> <td id="LC1345" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_getwd</span>(VALUE dir)</td> </tr> <tr> <td id="L1346" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1346"></td> <td id="LC1346" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1347" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1347"></td> <td id="LC1347" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_dir_getwd</span>();</td> </tr> <tr> <td id="L1348" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1348"></td> <td id="LC1348" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1349" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1349"></td> <td id="LC1349" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1350" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1350"></td> <td id="LC1350" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1351" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1351"></td> <td id="LC1351" class="blob-code blob-code-inner js-file-line"><span class="pl-en">check_dirname</span>(VALUE dir)</td> </tr> <tr> <td id="L1352" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1352"></td> <td id="LC1352" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1353" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1353"></td> <td id="LC1353" class="blob-code blob-code-inner js-file-line"> VALUE d = dir;</td> </tr> <tr> <td id="L1354" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1354"></td> <td id="LC1354" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *path, *pend;</td> </tr> <tr> <td id="L1355" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1355"></td> <td id="LC1355" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> len;</td> </tr> <tr> <td id="L1356" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1356"></td> <td id="LC1356" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc;</td> </tr> <tr> <td id="L1357" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1357"></td> <td id="LC1357" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1358" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1358"></td> <td id="LC1358" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FilePathValue</span>(d);</td> </tr> <tr> <td id="L1359" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1359"></td> <td id="LC1359" class="blob-code blob-code-inner js-file-line"> enc = <span class="pl-c1">rb_enc_get</span>(d);</td> </tr> <tr> <td id="L1360" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1360"></td> <td id="LC1360" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RSTRING_GETMEM</span>(d, path, len);</td> </tr> <tr> <td id="L1361" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1361"></td> <td id="LC1361" class="blob-code blob-code-inner js-file-line"> pend = path + len;</td> </tr> <tr> <td id="L1362" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1362"></td> <td id="LC1362" class="blob-code blob-code-inner js-file-line"> pend = <span class="pl-c1">rb_enc_path_end</span>(<span class="pl-c1">rb_enc_path_skip_prefix</span>(path, pend, enc), pend, enc);</td> </tr> <tr> <td id="L1363" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1363"></td> <td id="LC1363" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (pend - path < len) {</td> </tr> <tr> <td id="L1364" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1364"></td> <td id="LC1364" class="blob-code blob-code-inner js-file-line"> d = <span class="pl-c1">rb_str_subseq</span>(d, <span class="pl-c1">0</span>, pend - path);</td> </tr> <tr> <td id="L1365" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1365"></td> <td id="LC1365" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">StringValueCStr</span>(d);</td> </tr> <tr> <td id="L1366" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1366"></td> <td id="LC1366" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1367" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1367"></td> <td id="LC1367" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_str_encode_ospath</span>(d);</td> </tr> <tr> <td id="L1368" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1368"></td> <td id="LC1368" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1369" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1369"></td> <td id="LC1369" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1370" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1370"></td> <td id="LC1370" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined(HAVE_CHROOT)</td> </tr> <tr> <td id="L1371" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1371"></td> <td id="LC1371" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1372" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1372"></td> <td id="LC1372" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L1373" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1373"></td> <td id="LC1373" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.chroot( string ) -> 0</span></td> </tr> <tr> <td id="L1374" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1374"></td> <td id="LC1374" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1375" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1375"></td> <td id="LC1375" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Changes this process's idea of the file system root. Only a</span></td> </tr> <tr> <td id="L1376" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1376"></td> <td id="LC1376" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * privileged process may make this call. Not available on all</span></td> </tr> <tr> <td id="L1377" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1377"></td> <td id="LC1377" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * platforms. On Unix systems, see <code>chroot(2)</code> for more</span></td> </tr> <tr> <td id="L1378" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1378"></td> <td id="LC1378" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * information.</span></td> </tr> <tr> <td id="L1379" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1379"></td> <td id="LC1379" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1380" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1380"></td> <td id="LC1380" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1381" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1381"></td> <td id="LC1381" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_chroot</span>(VALUE dir, VALUE path)</td> </tr> <tr> <td id="L1382" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1382"></td> <td id="LC1382" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1383" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1383"></td> <td id="LC1383" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">check_dirname</span>(path);</td> </tr> <tr> <td id="L1384" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1384"></td> <td id="LC1384" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">chroot</span>(<span class="pl-c1">RSTRING_PTR</span>(path)) == -<span class="pl-c1">1</span>)</td> </tr> <tr> <td id="L1385" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1385"></td> <td id="LC1385" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(path);</td> </tr> <tr> <td id="L1386" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1386"></td> <td id="LC1386" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1387" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1387"></td> <td id="LC1387" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">INT2FIX</span>(<span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1388" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1388"></td> <td id="LC1388" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1389" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1389"></td> <td id="LC1389" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1390" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1390"></td> <td id="LC1390" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">dir_s_chroot</span> rb_f_notimplement</td> </tr> <tr> <td id="L1391" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1391"></td> <td id="LC1391" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1392" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1392"></td> <td id="LC1392" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1393" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1393"></td> <td id="LC1393" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> mkdir_arg {</td> </tr> <tr> <td id="L1394" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1394"></td> <td id="LC1394" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L1395" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1395"></td> <td id="LC1395" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">mode_t</span> mode;</td> </tr> <tr> <td id="L1396" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1396"></td> <td id="LC1396" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L1397" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1397"></td> <td id="LC1397" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1398" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1398"></td> <td id="LC1398" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1399" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1399"></td> <td id="LC1399" class="blob-code blob-code-inner js-file-line"><span class="pl-en">nogvl_mkdir</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L1400" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1400"></td> <td id="LC1400" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1401" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1401"></td> <td id="LC1401" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> mkdir_arg *m = ptr;</td> </tr> <tr> <td id="L1402" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1402"></td> <td id="LC1402" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1403" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1403"></td> <td id="LC1403" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)(VALUE)<span class="pl-c1">mkdir</span>(m-><span class="pl-smi">path</span>, m-><span class="pl-smi">mode</span>);</td> </tr> <tr> <td id="L1404" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1404"></td> <td id="LC1404" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1405" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1405"></td> <td id="LC1405" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1406" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1406"></td> <td id="LC1406" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1407" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1407"></td> <td id="LC1407" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L1408" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1408"></td> <td id="LC1408" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.mkdir( string [, integer] ) -> 0</span></td> </tr> <tr> <td id="L1409" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1409"></td> <td id="LC1409" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1410" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1410"></td> <td id="LC1410" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Makes a new directory named by <i>string</i>, with permissions</span></td> </tr> <tr> <td id="L1411" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1411"></td> <td id="LC1411" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * specified by the optional parameter <i>anInteger</i>. The</span></td> </tr> <tr> <td id="L1412" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1412"></td> <td id="LC1412" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * permissions may be modified by the value of File::umask, and are</span></td> </tr> <tr> <td id="L1413" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1413"></td> <td id="LC1413" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * ignored on NT. Raises a SystemCallError if the directory cannot be</span></td> </tr> <tr> <td id="L1414" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1414"></td> <td id="LC1414" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * created. See also the discussion of permissions in the class</span></td> </tr> <tr> <td id="L1415" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1415"></td> <td id="LC1415" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * documentation for File.</span></td> </tr> <tr> <td id="L1416" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1416"></td> <td id="LC1416" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1417" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1417"></td> <td id="LC1417" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0</span></td> </tr> <tr> <td id="L1418" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1418"></td> <td id="LC1418" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1419" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1419"></td> <td id="LC1419" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1420" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1420"></td> <td id="LC1420" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1421" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1421"></td> <td id="LC1421" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_mkdir</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE obj)</td> </tr> <tr> <td id="L1422" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1422"></td> <td id="LC1422" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1423" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1423"></td> <td id="LC1423" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> mkdir_arg m;</td> </tr> <tr> <td id="L1424" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1424"></td> <td id="LC1424" class="blob-code blob-code-inner js-file-line"> VALUE path, vmode;</td> </tr> <tr> <td id="L1425" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1425"></td> <td id="LC1425" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> r;</td> </tr> <tr> <td id="L1426" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1426"></td> <td id="LC1426" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1427" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1427"></td> <td id="LC1427" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_scan_args</span>(argc, argv, <span class="pl-s"><span class="pl-pds">"</span>11<span class="pl-pds">"</span></span>, &path, &vmode) == <span class="pl-c1">2</span>) {</td> </tr> <tr> <td id="L1428" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1428"></td> <td id="LC1428" class="blob-code blob-code-inner js-file-line"> m.<span class="pl-smi">mode</span> = <span class="pl-c1">NUM2MODET</span>(vmode);</td> </tr> <tr> <td id="L1429" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1429"></td> <td id="LC1429" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1430" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1430"></td> <td id="LC1430" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1431" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1431"></td> <td id="LC1431" class="blob-code blob-code-inner js-file-line"> m.<span class="pl-smi">mode</span> = <span class="pl-c1">0777</span>;</td> </tr> <tr> <td id="L1432" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1432"></td> <td id="LC1432" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1433" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1433"></td> <td id="LC1433" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1434" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1434"></td> <td id="LC1434" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">check_dirname</span>(path);</td> </tr> <tr> <td id="L1435" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1435"></td> <td id="LC1435" class="blob-code blob-code-inner js-file-line"> m.<span class="pl-smi">path</span> = <span class="pl-c1">RSTRING_PTR</span>(path);</td> </tr> <tr> <td id="L1436" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1436"></td> <td id="LC1436" class="blob-code blob-code-inner js-file-line"> r = (<span class="pl-k">int</span>)(VALUE)<span class="pl-c1">rb_thread_call_without_gvl</span>(nogvl_mkdir, &m, RUBY_UBF_IO, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1437" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1437"></td> <td id="LC1437" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (r < <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1438" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1438"></td> <td id="LC1438" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(path);</td> </tr> <tr> <td id="L1439" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1439"></td> <td id="LC1439" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1440" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1440"></td> <td id="LC1440" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">INT2FIX</span>(<span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1441" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1441"></td> <td id="LC1441" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1442" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1442"></td> <td id="LC1442" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1443" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1443"></td> <td id="LC1443" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1444" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1444"></td> <td id="LC1444" class="blob-code blob-code-inner js-file-line"><span class="pl-en">nogvl_rmdir</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L1445" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1445"></td> <td id="LC1445" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1446" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1446"></td> <td id="LC1446" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path = ptr;</td> </tr> <tr> <td id="L1447" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1447"></td> <td id="LC1447" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1448" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1448"></td> <td id="LC1448" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)(VALUE)<span class="pl-c1">rmdir</span>(path);</td> </tr> <tr> <td id="L1449" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1449"></td> <td id="LC1449" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1450" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1450"></td> <td id="LC1450" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1451" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1451"></td> <td id="LC1451" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1452" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1452"></td> <td id="LC1452" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L1453" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1453"></td> <td id="LC1453" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.delete( string ) -> 0</span></td> </tr> <tr> <td id="L1454" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1454"></td> <td id="LC1454" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.rmdir( string ) -> 0</span></td> </tr> <tr> <td id="L1455" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1455"></td> <td id="LC1455" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.unlink( string ) -> 0</span></td> </tr> <tr> <td id="L1456" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1456"></td> <td id="LC1456" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L1457" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1457"></td> <td id="LC1457" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Deletes the named directory. Raises a subclass of SystemCallError</span></td> </tr> <tr> <td id="L1458" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1458"></td> <td id="LC1458" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * if the directory isn't empty.</span></td> </tr> <tr> <td id="L1459" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1459"></td> <td id="LC1459" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1460" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1460"></td> <td id="LC1460" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1461" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1461"></td> <td id="LC1461" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_rmdir</span>(VALUE obj, VALUE dir)</td> </tr> <tr> <td id="L1462" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1462"></td> <td id="LC1462" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1463" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1463"></td> <td id="LC1463" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *p;</td> </tr> <tr> <td id="L1464" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1464"></td> <td id="LC1464" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> r;</td> </tr> <tr> <td id="L1465" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1465"></td> <td id="LC1465" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1466" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1466"></td> <td id="LC1466" class="blob-code blob-code-inner js-file-line"> dir = <span class="pl-c1">check_dirname</span>(dir);</td> </tr> <tr> <td id="L1467" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1467"></td> <td id="LC1467" class="blob-code blob-code-inner js-file-line"> p = <span class="pl-c1">RSTRING_PTR</span>(dir);</td> </tr> <tr> <td id="L1468" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1468"></td> <td id="LC1468" class="blob-code blob-code-inner js-file-line"> r = (<span class="pl-k">int</span>)(VALUE)<span class="pl-c1">rb_thread_call_without_gvl</span>(nogvl_rmdir, (<span class="pl-k">void</span> *)p, RUBY_UBF_IO, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1469" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1469"></td> <td id="LC1469" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (r < <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L1470" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1470"></td> <td id="LC1470" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(dir);</td> </tr> <tr> <td id="L1471" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1471"></td> <td id="LC1471" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1472" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1472"></td> <td id="LC1472" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">INT2FIX</span>(<span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1473" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1473"></td> <td id="LC1473" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1474" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1474"></td> <td id="LC1474" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1475" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1475"></td> <td id="LC1475" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> warning_args {</td> </tr> <tr> <td id="L1476" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1476"></td> <td id="LC1476" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> RUBY_FUNCTION_NAME_STRING</td> </tr> <tr> <td id="L1477" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1477"></td> <td id="LC1477" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *func;</td> </tr> <tr> <td id="L1478" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1478"></td> <td id="LC1478" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1479" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1479"></td> <td id="LC1479" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *mesg;</td> </tr> <tr> <td id="L1480" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1480"></td> <td id="LC1480" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc;</td> </tr> <tr> <td id="L1481" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1481"></td> <td id="LC1481" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L1482" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1482"></td> <td id="LC1482" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1483" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1483"></td> <td id="LC1483" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> RUBY_FUNCTION_NAME_STRING</td> </tr> <tr> <td id="L1484" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1484"></td> <td id="LC1484" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">sys_enc_warning_in</span>(<span class="pl-v">func, mesg, enc</span>) sys_enc_warning(mesg, enc)</td> </tr> <tr> <td id="L1485" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1485"></td> <td id="LC1485" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1486" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1486"></td> <td id="LC1486" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1487" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1487"></td> <td id="LC1487" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L1488" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1488"></td> <td id="LC1488" class="blob-code blob-code-inner js-file-line"><span class="pl-en">sys_warning_1</span>(VALUE mesg)</td> </tr> <tr> <td id="L1489" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1489"></td> <td id="LC1489" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1490" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1490"></td> <td id="LC1490" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">struct</span> warning_args *arg = (<span class="pl-k">struct</span> warning_args *)mesg;</td> </tr> <tr> <td id="L1491" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1491"></td> <td id="LC1491" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> RUBY_FUNCTION_NAME_STRING</td> </tr> <tr> <td id="L1492" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1492"></td> <td id="LC1492" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_enc_warning</span>(arg-><span class="pl-smi">enc</span>, <span class="pl-s"><span class="pl-pds">"</span><span class="pl-c1">%s</span>: <span class="pl-c1">%s</span><span class="pl-pds">"</span></span>, arg-><span class="pl-smi">func</span>, arg-><span class="pl-smi">mesg</span>);</td> </tr> <tr> <td id="L1493" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1493"></td> <td id="LC1493" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1494" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1494"></td> <td id="LC1494" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_enc_warning</span>(arg-><span class="pl-smi">enc</span>, <span class="pl-s"><span class="pl-pds">"</span><span class="pl-c1">%s</span><span class="pl-pds">"</span></span>, arg-><span class="pl-smi">mesg</span>);</td> </tr> <tr> <td id="L1495" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1495"></td> <td id="LC1495" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1496" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1496"></td> <td id="LC1496" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L1497" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1497"></td> <td id="LC1497" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1498" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1498"></td> <td id="LC1498" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1499" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1499"></td> <td id="LC1499" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L1500" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1500"></td> <td id="LC1500" class="blob-code blob-code-inner js-file-line"><span class="pl-en">sys_enc_warning_in</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *func, <span class="pl-k">const</span> <span class="pl-k">char</span> *mesg, rb_encoding *enc)</td> </tr> <tr> <td id="L1501" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1501"></td> <td id="LC1501" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1502" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1502"></td> <td id="LC1502" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> warning_args arg;</td> </tr> <tr> <td id="L1503" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1503"></td> <td id="LC1503" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> RUBY_FUNCTION_NAME_STRING</td> </tr> <tr> <td id="L1504" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1504"></td> <td id="LC1504" class="blob-code blob-code-inner js-file-line"> arg.<span class="pl-smi">func</span> = func;</td> </tr> <tr> <td id="L1505" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1505"></td> <td id="LC1505" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1506" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1506"></td> <td id="LC1506" class="blob-code blob-code-inner js-file-line"> arg.<span class="pl-smi">mesg</span> = mesg;</td> </tr> <tr> <td id="L1507" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1507"></td> <td id="LC1507" class="blob-code blob-code-inner js-file-line"> arg.<span class="pl-smi">enc</span> = enc;</td> </tr> <tr> <td id="L1508" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1508"></td> <td id="LC1508" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_protect</span>(sys_warning_1, (VALUE)&arg, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1509" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1509"></td> <td id="LC1509" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1510" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1510"></td> <td id="LC1510" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1511" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1511"></td> <td id="LC1511" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GLOB_VERBOSE</span> (<span class="pl-c1">1U</span> << (<span class="pl-k">sizeof</span>(<span class="pl-k">int</span>) * CHAR_BIT - <span class="pl-c1">1</span>))</td> </tr> <tr> <td id="L1512" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1512"></td> <td id="LC1512" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">sys_warning</span>(<span class="pl-v">val, enc</span>) \</td> </tr> <tr> <td id="L1513" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1513"></td> <td id="LC1513" class="blob-code blob-code-inner js-file-line"> ((flags & GLOB_VERBOSE) ? sys_enc_warning_in(RUBY_FUNCTION_NAME_STRING, (val), (enc)) :(<span class="pl-k">void</span>)0)</td> </tr> <tr> <td id="L1514" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1514"></td> <td id="LC1514" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1515" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1515"></td> <td id="LC1515" class="blob-code blob-code-inner js-file-line">static inline size_t</td> </tr> <tr> <td id="L1516" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1516"></td> <td id="LC1516" class="blob-code blob-code-inner js-file-line">glob_alloc_size(<span class="pl-c1">size_t</span> x, <span class="pl-c1">size_t</span> y)</td> </tr> <tr> <td id="L1517" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1517"></td> <td id="LC1517" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1518" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1518"></td> <td id="LC1518" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> z;</td> </tr> <tr> <td id="L1519" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1519"></td> <td id="LC1519" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_mul_size_overflow</span>(x, y, SSIZE_MAX, &z)) {</td> </tr> <tr> <td id="L1520" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1520"></td> <td id="LC1520" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_memerror</span>(); <span class="pl-c"><span class="pl-c">/*</span> or...? <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1521" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1521"></td> <td id="LC1521" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1522" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1522"></td> <td id="LC1522" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1523" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1523"></td> <td id="LC1523" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> z;</td> </tr> <tr> <td id="L1524" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1524"></td> <td id="LC1524" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1525" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1525"></td> <td id="LC1525" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1526" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1526"></td> <td id="LC1526" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1527" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1527"></td> <td id="LC1527" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">inline</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1528" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1528"></td> <td id="LC1528" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_alloc_n</span>(<span class="pl-c1">size_t</span> x, <span class="pl-c1">size_t</span> y)</td> </tr> <tr> <td id="L1529" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1529"></td> <td id="LC1529" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1530" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1530"></td> <td id="LC1530" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">malloc</span>(<span class="pl-c1">glob_alloc_size</span>(x, y));</td> </tr> <tr> <td id="L1531" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1531"></td> <td id="LC1531" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1532" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1532"></td> <td id="LC1532" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1533" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1533"></td> <td id="LC1533" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">inline</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1534" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1534"></td> <td id="LC1534" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_realloc_n</span>(<span class="pl-k">void</span> *p, <span class="pl-c1">size_t</span> x, <span class="pl-c1">size_t</span> y)</td> </tr> <tr> <td id="L1535" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1535"></td> <td id="LC1535" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1536" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1536"></td> <td id="LC1536" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">realloc</span>(p, <span class="pl-c1">glob_alloc_size</span>(x, y));</td> </tr> <tr> <td id="L1537" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1537"></td> <td id="LC1537" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1538" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1538"></td> <td id="LC1538" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1539" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1539"></td> <td id="LC1539" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GLOB_ALLOC</span>(<span class="pl-v">type</span>) ((type *)malloc(<span class="pl-k">sizeof</span>(type)))</td> </tr> <tr> <td id="L1540" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1540"></td> <td id="LC1540" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GLOB_ALLOC_N</span>(<span class="pl-v">type, n</span>) ((type *)glob_alloc_n(<span class="pl-k">sizeof</span>(type), n))</td> </tr> <tr> <td id="L1541" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1541"></td> <td id="LC1541" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GLOB_REALLOC</span>(<span class="pl-v">ptr, size</span>) realloc((ptr), (size))</td> </tr> <tr> <td id="L1542" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1542"></td> <td id="LC1542" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GLOB_REALLOC_N</span>(<span class="pl-v">ptr, n</span>) glob_realloc_n(ptr, <span class="pl-k">sizeof</span>(*(ptr)), n)</td> </tr> <tr> <td id="L1543" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1543"></td> <td id="LC1543" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GLOB_FREE</span>(<span class="pl-v">ptr</span>) free(ptr)</td> </tr> <tr> <td id="L1544" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1544"></td> <td id="LC1544" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">GLOB_JUMP_TAG</span>(<span class="pl-v">status</span>) (((status) == -<span class="pl-c1">1</span>) ? rb_memerror() : rb_jump_tag(status))</td> </tr> <tr> <td id="L1545" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1545"></td> <td id="LC1545" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1546" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1546"></td> <td id="LC1546" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L1547" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1547"></td> <td id="LC1547" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * ENOTDIR can be returned by stat(2) if a non-leaf element of the path</span></td> </tr> <tr> <td id="L1548" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1548"></td> <td id="LC1548" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * is not a directory.</span></td> </tr> <tr> <td id="L1549" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1549"></td> <td id="LC1549" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1550" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1550"></td> <td id="LC1550" class="blob-code blob-code-inner js-file-line"><span class="pl-en">ALWAYS_INLINE</span>(<span class="pl-k">static</span> <span class="pl-k">int</span> <span class="pl-en">to_be_ignored</span>(<span class="pl-k">int</span> e));</td> </tr> <tr> <td id="L1551" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1551"></td> <td id="LC1551" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">inline</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L1552" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1552"></td> <td id="LC1552" class="blob-code blob-code-inner js-file-line"><span class="pl-en">to_be_ignored</span>(<span class="pl-k">int</span> e)</td> </tr> <tr> <td id="L1553" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1553"></td> <td id="LC1553" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1554" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1554"></td> <td id="LC1554" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> e == ENOENT || e == ENOTDIR;</td> </tr> <tr> <td id="L1555" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1555"></td> <td id="LC1555" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1556" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1556"></td> <td id="LC1556" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1557" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1557"></td> <td id="LC1557" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L1558" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1558"></td> <td id="LC1558" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">STAT</span>(<span class="pl-v">p, s</span>) rb_w32_ustati128((p), (s))</td> </tr> <tr> <td id="L1559" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1559"></td> <td id="LC1559" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">undef</span> lstat</td> </tr> <tr> <td id="L1560" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1560"></td> <td id="LC1560" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">lstat</span>(<span class="pl-v">p, s</span>) rb_w32_ulstati128((p), (s))</td> </tr> <tr> <td id="L1561" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1561"></td> <td id="LC1561" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1562" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1562"></td> <td id="LC1562" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">STAT</span>(<span class="pl-v">p, s</span>) stat((p), (s))</td> </tr> <tr> <td id="L1563" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1563"></td> <td id="LC1563" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1564" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1564"></td> <td id="LC1564" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1565" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1565"></td> <td id="LC1565" class="blob-code blob-code-inner js-file-line"><span class="pl-k">typedef</span> <span class="pl-k">int</span> <span class="pl-en">ruby_glob_errfunc</span>(<span class="pl-k">const</span> <span class="pl-k">char</span>*, VALUE, <span class="pl-k">const</span> <span class="pl-k">void</span>*, <span class="pl-k">int</span>);</td> </tr> <tr> <td id="L1566" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1566"></td> <td id="LC1566" class="blob-code blob-code-inner js-file-line"><span class="pl-k">typedef</span> <span class="pl-k">struct</span> {</td> </tr> <tr> <td id="L1567" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1567"></td> <td id="LC1567" class="blob-code blob-code-inner js-file-line"> ruby_glob_func *match;</td> </tr> <tr> <td id="L1568" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1568"></td> <td id="LC1568" class="blob-code blob-code-inner js-file-line"> ruby_glob_errfunc *error;</td> </tr> <tr> <td id="L1569" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1569"></td> <td id="LC1569" class="blob-code blob-code-inner js-file-line">} <span class="pl-c1">ruby_glob_funcs_t</span>;</td> </tr> <tr> <td id="L1570" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1570"></td> <td id="LC1570" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1571" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1571"></td> <td id="LC1571" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">const</span> <span class="pl-k">char</span> *</td> </tr> <tr> <td id="L1572" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1572"></td> <td id="LC1572" class="blob-code blob-code-inner js-file-line"><span class="pl-en">at_subpath</span>(<span class="pl-k">int</span> fd, <span class="pl-c1">size_t</span> baselen, <span class="pl-k">const</span> <span class="pl-k">char</span> *path)</td> </tr> <tr> <td id="L1573" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1573"></td> <td id="LC1573" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1574" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1574"></td> <td id="LC1574" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_OPENDIR_AT</td> </tr> <tr> <td id="L1575" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1575"></td> <td id="LC1575" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (fd != (<span class="pl-k">int</span>)AT_FDCWD && baselen > <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L1576" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1576"></td> <td id="LC1576" class="blob-code blob-code-inner js-file-line"> path += baselen;</td> </tr> <tr> <td id="L1577" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1577"></td> <td id="LC1577" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*path == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>) ++path;</td> </tr> <tr> <td id="L1578" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1578"></td> <td id="LC1578" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1579" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1579"></td> <td id="LC1579" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1580" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1580"></td> <td id="LC1580" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> *path ? path : <span class="pl-s"><span class="pl-pds">"</span>.<span class="pl-pds">"</span></span>;</td> </tr> <tr> <td id="L1581" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1581"></td> <td id="LC1581" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1582" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1582"></td> <td id="LC1582" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1583" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1583"></td> <td id="LC1583" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> System call with warning <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1584" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1584"></td> <td id="LC1584" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L1585" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1585"></td> <td id="LC1585" class="blob-code blob-code-inner js-file-line"><span class="pl-en">do_stat</span>(<span class="pl-k">int</span> fd, <span class="pl-c1">size_t</span> baselen, <span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-k">struct</span> stat *pst, <span class="pl-k">int</span> flags, rb_encoding *enc)</td> </tr> <tr> <td id="L1586" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1586"></td> <td id="LC1586" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1587" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1587"></td> <td id="LC1587" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_OPENDIR_AT</td> </tr> <tr> <td id="L1588" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1588"></td> <td id="LC1588" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ret = <span class="pl-c1">fstatat</span>(fd, <span class="pl-c1">at_subpath</span>(fd, baselen, path), pst, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1589" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1589"></td> <td id="LC1589" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1590" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1590"></td> <td id="LC1590" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ret = <span class="pl-c1">STAT</span>(path, pst);</td> </tr> <tr> <td id="L1591" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1591"></td> <td id="LC1591" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1592" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1592"></td> <td id="LC1592" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (ret < <span class="pl-c1">0</span> && !<span class="pl-c1">to_be_ignored</span>(errno))</td> </tr> <tr> <td id="L1593" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1593"></td> <td id="LC1593" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">sys_warning</span>(path, enc);</td> </tr> <tr> <td id="L1594" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1594"></td> <td id="LC1594" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1595" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1595"></td> <td id="LC1595" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ret;</td> </tr> <tr> <td id="L1596" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1596"></td> <td id="LC1596" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1597" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1597"></td> <td id="LC1597" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1598" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1598"></td> <td id="LC1598" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined HAVE_LSTAT || defined lstat || USE_OPENDIR_AT</td> </tr> <tr> <td id="L1599" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1599"></td> <td id="LC1599" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L1600" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1600"></td> <td id="LC1600" class="blob-code blob-code-inner js-file-line"><span class="pl-en">do_lstat</span>(<span class="pl-k">int</span> fd, <span class="pl-c1">size_t</span> baselen, <span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-k">struct</span> stat *pst, <span class="pl-k">int</span> flags, rb_encoding *enc)</td> </tr> <tr> <td id="L1601" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1601"></td> <td id="LC1601" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1602" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1602"></td> <td id="LC1602" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_OPENDIR_AT</td> </tr> <tr> <td id="L1603" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1603"></td> <td id="LC1603" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ret = <span class="pl-c1">fstatat</span>(fd, <span class="pl-c1">at_subpath</span>(fd, baselen, path), pst, AT_SYMLINK_NOFOLLOW);</td> </tr> <tr> <td id="L1604" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1604"></td> <td id="LC1604" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1605" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1605"></td> <td id="LC1605" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> ret = <span class="pl-c1">lstat</span>(path, pst);</td> </tr> <tr> <td id="L1606" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1606"></td> <td id="LC1606" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1607" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1607"></td> <td id="LC1607" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (ret < <span class="pl-c1">0</span> && !<span class="pl-c1">to_be_ignored</span>(errno))</td> </tr> <tr> <td id="L1608" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1608"></td> <td id="LC1608" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">sys_warning</span>(path, enc);</td> </tr> <tr> <td id="L1609" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1609"></td> <td id="LC1609" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1610" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1610"></td> <td id="LC1610" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ret;</td> </tr> <tr> <td id="L1611" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1611"></td> <td id="LC1611" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1612" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1612"></td> <td id="LC1612" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L1613" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1613"></td> <td id="LC1613" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">do_lstat</span> do_stat</td> </tr> <tr> <td id="L1614" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1614"></td> <td id="LC1614" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1615" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1615"></td> <td id="LC1615" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1616" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1616"></td> <td id="LC1616" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> opendir_at_arg {</td> </tr> <tr> <td id="L1617" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1617"></td> <td id="LC1617" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> basefd;</td> </tr> <tr> <td id="L1618" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1618"></td> <td id="LC1618" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L1619" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1619"></td> <td id="LC1619" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L1620" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1620"></td> <td id="LC1620" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1621" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1621"></td> <td id="LC1621" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1622" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1622"></td> <td id="LC1622" class="blob-code blob-code-inner js-file-line"><span class="pl-en">with_gvl_gc_for_fd</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L1623" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1623"></td> <td id="LC1623" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1624" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1624"></td> <td id="LC1624" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> *e = ptr;</td> </tr> <tr> <td id="L1625" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1625"></td> <td id="LC1625" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1626" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1626"></td> <td id="LC1626" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)<span class="pl-c1">RBOOL</span>(<span class="pl-c1">rb_gc_for_fd</span>(*e));</td> </tr> <tr> <td id="L1627" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1627"></td> <td id="LC1627" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1628" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1628"></td> <td id="LC1628" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1629" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1629"></td> <td id="LC1629" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L1630" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1630"></td> <td id="LC1630" class="blob-code blob-code-inner js-file-line"><span class="pl-en">gc_for_fd_with_gvl</span>(<span class="pl-k">int</span> e)</td> </tr> <tr> <td id="L1631" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1631"></td> <td id="LC1631" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1632" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1632"></td> <td id="LC1632" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (vm_initialized)</td> </tr> <tr> <td id="L1633" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1633"></td> <td id="LC1633" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">int</span>)(VALUE)<span class="pl-c1">rb_thread_call_with_gvl</span>(with_gvl_gc_for_fd, &e);</td> </tr> <tr> <td id="L1634" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1634"></td> <td id="LC1634" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L1635" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1635"></td> <td id="LC1635" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">RBOOL</span>(<span class="pl-c1">rb_gc_for_fd</span>(e));</td> </tr> <tr> <td id="L1636" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1636"></td> <td id="LC1636" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1637" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1637"></td> <td id="LC1637" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1638" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1638"></td> <td id="LC1638" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L1639" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1639"></td> <td id="LC1639" class="blob-code blob-code-inner js-file-line"><span class="pl-en">nogvl_opendir_at</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L1640" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1640"></td> <td id="LC1640" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1641" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1641"></td> <td id="LC1641" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">struct</span> opendir_at_arg *oaa = ptr;</td> </tr> <tr> <td id="L1642" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1642"></td> <td id="LC1642" class="blob-code blob-code-inner js-file-line"> DIR *dirp;</td> </tr> <tr> <td id="L1643" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1643"></td> <td id="LC1643" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1644" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1644"></td> <td id="LC1644" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_OPENDIR_AT</td> </tr> <tr> <td id="L1645" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1645"></td> <td id="LC1645" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> opendir_flags = (O_RDONLY|O_CLOEXEC|</td> </tr> <tr> <td id="L1646" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1646"></td> <td id="LC1646" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">ifdef</span> O_DIRECTORY</td> </tr> <tr> <td id="L1647" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1647"></td> <td id="LC1647" class="blob-code blob-code-inner js-file-line"> O_DIRECTORY|</td> </tr> <tr> <td id="L1648" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1648"></td> <td id="LC1648" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span> <span class="pl-c"><span class="pl-c">/*</span> O_DIRECTORY <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1649" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1649"></td> <td id="LC1649" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1650" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1650"></td> <td id="LC1650" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd = <span class="pl-c1">openat</span>(oaa-><span class="pl-smi">basefd</span>, oaa-><span class="pl-smi">path</span>, opendir_flags);</td> </tr> <tr> <td id="L1651" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1651"></td> <td id="LC1651" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1652" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1652"></td> <td id="LC1652" class="blob-code blob-code-inner js-file-line"> dirp = fd >= <span class="pl-c1">0</span> ? <span class="pl-c1">fdopendir</span>(fd) : <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1653" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1653"></td> <td id="LC1653" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dirp) {</td> </tr> <tr> <td id="L1654" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1654"></td> <td id="LC1654" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> e = errno;</td> </tr> <tr> <td id="L1655" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1655"></td> <td id="LC1655" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1656" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1656"></td> <td id="LC1656" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (<span class="pl-c1">gc_for_fd_with_gvl</span>(e)) {</td> </tr> <tr> <td id="L1657" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1657"></td> <td id="LC1657" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L1658" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1658"></td> <td id="LC1658" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (fd < <span class="pl-c1">0</span>) fd = <span class="pl-c1">openat</span>(oaa-><span class="pl-smi">basefd</span>, oaa-><span class="pl-smi">path</span>, opendir_flags);</td> </tr> <tr> <td id="L1659" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1659"></td> <td id="LC1659" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (fd >= <span class="pl-c1">0</span>) dirp = <span class="pl-c1">fdopendir</span>(fd);</td> </tr> <tr> <td id="L1660" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1660"></td> <td id="LC1660" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dirp) <span class="pl-k">return</span> dirp;</td> </tr> <tr> <td id="L1661" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1661"></td> <td id="LC1661" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1662" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1662"></td> <td id="LC1662" class="blob-code blob-code-inner js-file-line"> e = errno;</td> </tr> <tr> <td id="L1663" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1663"></td> <td id="LC1663" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> fallthrough<span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1664" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1664"></td> <td id="LC1664" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-c1">0</span>:</td> </tr> <tr> <td id="L1665" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1665"></td> <td id="LC1665" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (fd >= <span class="pl-c1">0</span>) <span class="pl-c1">close</span>(fd);</td> </tr> <tr> <td id="L1666" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1666"></td> <td id="LC1666" class="blob-code blob-code-inner js-file-line"> errno = e;</td> </tr> <tr> <td id="L1667" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1667"></td> <td id="LC1667" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1668" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1668"></td> <td id="LC1668" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1669" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1669"></td> <td id="LC1669" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span> <span class="pl-c"><span class="pl-c">/*</span> !USE_OPENDIR_AT <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1670" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1670"></td> <td id="LC1670" class="blob-code blob-code-inner js-file-line"> dirp = <span class="pl-c1">opendir</span>(oaa-><span class="pl-smi">path</span>);</td> </tr> <tr> <td id="L1671" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1671"></td> <td id="LC1671" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dirp && <span class="pl-c1">gc_for_fd_with_gvl</span>(errno))</td> </tr> <tr> <td id="L1672" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1672"></td> <td id="LC1672" class="blob-code blob-code-inner js-file-line"> dirp = <span class="pl-c1">opendir</span>(oaa-><span class="pl-smi">path</span>);</td> </tr> <tr> <td id="L1673" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1673"></td> <td id="LC1673" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span> <span class="pl-c"><span class="pl-c">/*</span> !USE_OPENDIR_AT <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1674" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1674"></td> <td id="LC1674" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1675" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1675"></td> <td id="LC1675" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dirp;</td> </tr> <tr> <td id="L1676" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1676"></td> <td id="LC1676" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1677" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1677"></td> <td id="LC1677" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1678" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1678"></td> <td id="LC1678" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> DIR *</td> </tr> <tr> <td id="L1679" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1679"></td> <td id="LC1679" class="blob-code blob-code-inner js-file-line"><span class="pl-en">opendir_at</span>(<span class="pl-k">int</span> basefd, <span class="pl-k">const</span> <span class="pl-k">char</span> *path)</td> </tr> <tr> <td id="L1680" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1680"></td> <td id="LC1680" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1681" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1681"></td> <td id="LC1681" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> opendir_at_arg oaa;</td> </tr> <tr> <td id="L1682" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1682"></td> <td id="LC1682" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1683" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1683"></td> <td id="LC1683" class="blob-code blob-code-inner js-file-line"> oaa.<span class="pl-smi">basefd</span> = basefd;</td> </tr> <tr> <td id="L1684" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1684"></td> <td id="LC1684" class="blob-code blob-code-inner js-file-line"> oaa.<span class="pl-smi">path</span> = path;</td> </tr> <tr> <td id="L1685" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1685"></td> <td id="LC1685" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1686" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1686"></td> <td id="LC1686" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (vm_initialized)</td> </tr> <tr> <td id="L1687" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1687"></td> <td id="LC1687" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_thread_call_without_gvl</span>(nogvl_opendir_at, &oaa, RUBY_UBF_IO, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L1688" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1688"></td> <td id="LC1688" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L1689" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1689"></td> <td id="LC1689" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">nogvl_opendir_at</span>(&oaa);</td> </tr> <tr> <td id="L1690" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1690"></td> <td id="LC1690" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1691" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1691"></td> <td id="LC1691" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1692" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1692"></td> <td id="LC1692" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> DIR *</td> </tr> <tr> <td id="L1693" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1693"></td> <td id="LC1693" class="blob-code blob-code-inner js-file-line"><span class="pl-en">do_opendir</span>(<span class="pl-k">const</span> <span class="pl-k">int</span> basefd, <span class="pl-c1">size_t</span> baselen, <span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-k">int</span> flags, rb_encoding *enc,</td> </tr> <tr> <td id="L1694" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1694"></td> <td id="LC1694" class="blob-code blob-code-inner js-file-line"> ruby_glob_errfunc *errfunc, VALUE arg, <span class="pl-k">int</span> *status)</td> </tr> <tr> <td id="L1695" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1695"></td> <td id="LC1695" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1696" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1696"></td> <td id="LC1696" class="blob-code blob-code-inner js-file-line"> DIR *dirp;</td> </tr> <tr> <td id="L1697" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1697"></td> <td id="LC1697" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L1698" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1698"></td> <td id="LC1698" class="blob-code blob-code-inner js-file-line"> VALUE tmp = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1699" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1699"></td> <td id="LC1699" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">fundamental_encoding_p</span>(enc)) {</td> </tr> <tr> <td id="L1700" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1700"></td> <td id="LC1700" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">rb_enc_str_new</span>(path, <span class="pl-c1">strlen</span>(path), enc);</td> </tr> <tr> <td id="L1701" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1701"></td> <td id="LC1701" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">rb_str_encode_ospath</span>(tmp);</td> </tr> <tr> <td id="L1702" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1702"></td> <td id="LC1702" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">RSTRING_PTR</span>(tmp);</td> </tr> <tr> <td id="L1703" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1703"></td> <td id="LC1703" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1704" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1704"></td> <td id="LC1704" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1705" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1705"></td> <td id="LC1705" class="blob-code blob-code-inner js-file-line"> dirp = <span class="pl-c1">opendir_at</span>(basefd, <span class="pl-c1">at_subpath</span>(basefd, baselen, path));</td> </tr> <tr> <td id="L1706" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1706"></td> <td id="LC1706" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dirp) {</td> </tr> <tr> <td id="L1707" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1707"></td> <td id="LC1707" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> e = errno;</td> </tr> <tr> <td id="L1708" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1708"></td> <td id="LC1708" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1709" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1709"></td> <td id="LC1709" class="blob-code blob-code-inner js-file-line"> *status = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1710" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1710"></td> <td id="LC1710" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">to_be_ignored</span>(e)) {</td> </tr> <tr> <td id="L1711" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1711"></td> <td id="LC1711" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (errfunc) {</td> </tr> <tr> <td id="L1712" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1712"></td> <td id="LC1712" class="blob-code blob-code-inner js-file-line"> *status = (*errfunc)(path, arg, enc, e);</td> </tr> <tr> <td id="L1713" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1713"></td> <td id="LC1713" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1714" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1714"></td> <td id="LC1714" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1715" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1715"></td> <td id="LC1715" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">sys_warning</span>(path, enc);</td> </tr> <tr> <td id="L1716" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1716"></td> <td id="LC1716" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1717" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1717"></td> <td id="LC1717" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1718" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1718"></td> <td id="LC1718" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1719" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1719"></td> <td id="LC1719" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L1720" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1720"></td> <td id="LC1720" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (tmp) <span class="pl-c1">rb_str_resize</span>(tmp, <span class="pl-c1">0</span>); <span class="pl-c"><span class="pl-c">/*</span> GC guard <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1721" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1721"></td> <td id="LC1721" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1722" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1722"></td> <td id="LC1722" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1723" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1723"></td> <td id="LC1723" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dirp;</td> </tr> <tr> <td id="L1724" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1724"></td> <td id="LC1724" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1725" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1725"></td> <td id="LC1725" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1726" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1726"></td> <td id="LC1726" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> Globing pattern <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1727" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1727"></td> <td id="LC1727" class="blob-code blob-code-inner js-file-line"><span class="pl-k">enum</span> glob_pattern_type { PLAIN, ALPHA, BRACE, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR };</td> </tr> <tr> <td id="L1728" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1728"></td> <td id="LC1728" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1729" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1729"></td> <td id="LC1729" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> Return nonzero if S has any special globbing chars in it. <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1730" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1730"></td> <td id="LC1730" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">enum</span> glob_pattern_type</td> </tr> <tr> <td id="L1731" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1731"></td> <td id="LC1731" class="blob-code blob-code-inner js-file-line"><span class="pl-en">has_magic</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *p, <span class="pl-k">const</span> <span class="pl-k">char</span> *pend, <span class="pl-k">int</span> flags, rb_encoding *enc)</td> </tr> <tr> <td id="L1732" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1732"></td> <td id="LC1732" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1733" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1733"></td> <td id="LC1733" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> escape = !(flags & FNM_NOESCAPE);</td> </tr> <tr> <td id="L1734" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1734"></td> <td id="LC1734" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> hasalpha = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1735" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1735"></td> <td id="LC1735" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> hasmagical = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1736" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1736"></td> <td id="LC1736" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1737" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1737"></td> <td id="LC1737" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">register</span> <span class="pl-k">char</span> c;</td> </tr> <tr> <td id="L1738" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1738"></td> <td id="LC1738" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1739" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1739"></td> <td id="LC1739" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (p < pend && (c = *p++) != <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L1740" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1740"></td> <td id="LC1740" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (c) {</td> </tr> <tr> <td id="L1741" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1741"></td> <td id="LC1741" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>{<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1742" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1742"></td> <td id="LC1742" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> BRACE;</td> </tr> <tr> <td id="L1743" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1743"></td> <td id="LC1743" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1744" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1744"></td> <td id="LC1744" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1745" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1745"></td> <td id="LC1745" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>?<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1746" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1746"></td> <td id="LC1746" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>[<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1747" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1747"></td> <td id="LC1747" class="blob-code blob-code-inner js-file-line"> hasmagical = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1748" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1748"></td> <td id="LC1748" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L1749" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1749"></td> <td id="LC1749" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1750" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1750"></td> <td id="LC1750" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1751" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1751"></td> <td id="LC1751" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (escape && p++ >= pend)</td> </tr> <tr> <td id="L1752" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1752"></td> <td id="LC1752" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L1753" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1753"></td> <td id="LC1753" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L1754" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1754"></td> <td id="LC1754" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1755" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1755"></td> <td id="LC1755" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L1756" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1756"></td> <td id="LC1756" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1757" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1757"></td> <td id="LC1757" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L1758" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1758"></td> <td id="LC1758" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1759" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1759"></td> <td id="LC1759" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>~<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1760" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1760"></td> <td id="LC1760" class="blob-code blob-code-inner js-file-line"> hasalpha = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1761" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1761"></td> <td id="LC1761" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L1762" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1762"></td> <td id="LC1762" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L1763" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1763"></td> <td id="LC1763" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L1764" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1764"></td> <td id="LC1764" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (IS_WIN32 || <span class="pl-c1">ISALPHA</span>(c)) {</td> </tr> <tr> <td id="L1765" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1765"></td> <td id="LC1765" class="blob-code blob-code-inner js-file-line"> hasalpha = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1766" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1766"></td> <td id="LC1766" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1767" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1767"></td> <td id="LC1767" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L1768" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1768"></td> <td id="LC1768" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1769" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1769"></td> <td id="LC1769" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1770" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1770"></td> <td id="LC1770" class="blob-code blob-code-inner js-file-line"> p = <span class="pl-c1">Next</span>(p-<span class="pl-c1">1</span>, pend, enc);</td> </tr> <tr> <td id="L1771" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1771"></td> <td id="LC1771" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1772" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1772"></td> <td id="LC1772" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1773" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1773"></td> <td id="LC1773" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> hasmagical ? MAGICAL : hasalpha ? ALPHA : PLAIN;</td> </tr> <tr> <td id="L1774" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1774"></td> <td id="LC1774" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1775" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1775"></td> <td id="LC1775" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1776" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1776"></td> <td id="LC1776" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> Find separator in globbing pattern. <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1777" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1777"></td> <td id="LC1777" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">char</span> *</td> </tr> <tr> <td id="L1778" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1778"></td> <td id="LC1778" class="blob-code blob-code-inner js-file-line"><span class="pl-en">find_dirsep</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *p, <span class="pl-k">const</span> <span class="pl-k">char</span> *pend, <span class="pl-k">int</span> flags, rb_encoding *enc)</td> </tr> <tr> <td id="L1779" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1779"></td> <td id="LC1779" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1780" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1780"></td> <td id="LC1780" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> escape = !(flags & FNM_NOESCAPE);</td> </tr> <tr> <td id="L1781" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1781"></td> <td id="LC1781" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1782" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1782"></td> <td id="LC1782" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">register</span> <span class="pl-k">char</span> c;</td> </tr> <tr> <td id="L1783" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1783"></td> <td id="LC1783" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> <span class="pl-c1">open</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1784" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1784"></td> <td id="LC1784" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1785" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1785"></td> <td id="LC1785" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> ((c = *p++) != <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L1786" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1786"></td> <td id="LC1786" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (c) {</td> </tr> <tr> <td id="L1787" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1787"></td> <td id="LC1787" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>[<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1788" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1788"></td> <td id="LC1788" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">open</span> = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1789" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1789"></td> <td id="LC1789" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L1790" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1790"></td> <td id="LC1790" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>]<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1791" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1791"></td> <td id="LC1791" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">open</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1792" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1792"></td> <td id="LC1792" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L1793" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1793"></td> <td id="LC1793" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1794" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1794"></td> <td id="LC1794" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>{<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1795" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1795"></td> <td id="LC1795" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">open</span> = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1796" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1796"></td> <td id="LC1796" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L1797" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1797"></td> <td id="LC1797" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>}<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1798" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1798"></td> <td id="LC1798" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">open</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1799" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1799"></td> <td id="LC1799" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L1800" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1800"></td> <td id="LC1800" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1801" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1801"></td> <td id="LC1801" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1802" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1802"></td> <td id="LC1802" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">open</span>)</td> </tr> <tr> <td id="L1803" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1803"></td> <td id="LC1803" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">char</span> *)p-<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1804" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1804"></td> <td id="LC1804" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L1805" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1805"></td> <td id="LC1805" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1806" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1806"></td> <td id="LC1806" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span>:</td> </tr> <tr> <td id="L1807" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1807"></td> <td id="LC1807" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (escape && !(c = *p++))</td> </tr> <tr> <td id="L1808" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1808"></td> <td id="LC1808" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">char</span> *)p-<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1809" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1809"></td> <td id="LC1809" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L1810" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1810"></td> <td id="LC1810" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1811" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1811"></td> <td id="LC1811" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1812" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1812"></td> <td id="LC1812" class="blob-code blob-code-inner js-file-line"> p = <span class="pl-c1">Next</span>(p-<span class="pl-c1">1</span>, pend, enc);</td> </tr> <tr> <td id="L1813" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1813"></td> <td id="LC1813" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1814" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1814"></td> <td id="LC1814" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1815" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1815"></td> <td id="LC1815" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">char</span> *)p-<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1816" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1816"></td> <td id="LC1816" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1817" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1817"></td> <td id="LC1817" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1818" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1818"></td> <td id="LC1818" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> Remove escaping backslashes <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1819" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1819"></td> <td id="LC1819" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">char</span> *</td> </tr> <tr> <td id="L1820" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1820"></td> <td id="LC1820" class="blob-code blob-code-inner js-file-line"><span class="pl-en">remove_backslashes</span>(<span class="pl-k">char</span> *p, <span class="pl-k">register</span> <span class="pl-k">const</span> <span class="pl-k">char</span> *pend, rb_encoding *enc)</td> </tr> <tr> <td id="L1821" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1821"></td> <td id="LC1821" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1822" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1822"></td> <td id="LC1822" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *t = p;</td> </tr> <tr> <td id="L1823" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1823"></td> <td id="LC1823" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *s = p;</td> </tr> <tr> <td id="L1824" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1824"></td> <td id="LC1824" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1825" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1825"></td> <td id="LC1825" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (*p) {</td> </tr> <tr> <td id="L1826" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1826"></td> <td id="LC1826" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L1827" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1827"></td> <td id="LC1827" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (t != s)</td> </tr> <tr> <td id="L1828" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1828"></td> <td id="LC1828" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memmove</span>(t, s, p - s);</td> </tr> <tr> <td id="L1829" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1829"></td> <td id="LC1829" class="blob-code blob-code-inner js-file-line"> t += p - s;</td> </tr> <tr> <td id="L1830" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1830"></td> <td id="LC1830" class="blob-code blob-code-inner js-file-line"> s = ++p;</td> </tr> <tr> <td id="L1831" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1831"></td> <td id="LC1831" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!*p) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L1832" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1832"></td> <td id="LC1832" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1833" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1833"></td> <td id="LC1833" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Inc</span>(p, pend, enc);</td> </tr> <tr> <td id="L1834" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1834"></td> <td id="LC1834" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1835" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1835"></td> <td id="LC1835" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1836" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1836"></td> <td id="LC1836" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (*p++);</td> </tr> <tr> <td id="L1837" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1837"></td> <td id="LC1837" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1838" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1838"></td> <td id="LC1838" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (t != s)</td> </tr> <tr> <td id="L1839" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1839"></td> <td id="LC1839" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memmove</span>(t, s, p - s); <span class="pl-c"><span class="pl-c">/*</span> move '\0' too <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1840" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1840"></td> <td id="LC1840" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1841" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1841"></td> <td id="LC1841" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> p;</td> </tr> <tr> <td id="L1842" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1842"></td> <td id="LC1842" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1843" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1843"></td> <td id="LC1843" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1844" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1844"></td> <td id="LC1844" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> glob_pattern {</td> </tr> <tr> <td id="L1845" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1845"></td> <td id="LC1845" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *str;</td> </tr> <tr> <td id="L1846" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1846"></td> <td id="LC1846" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">enum</span> glob_pattern_type type;</td> </tr> <tr> <td id="L1847" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1847"></td> <td id="LC1847" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *next;</td> </tr> <tr> <td id="L1848" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1848"></td> <td id="LC1848" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L1849" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1849"></td> <td id="LC1849" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1850" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1850"></td> <td id="LC1850" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">glob_free_pattern</span>(<span class="pl-k">struct</span> glob_pattern *list);</td> </tr> <tr> <td id="L1851" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1851"></td> <td id="LC1851" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1852" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1852"></td> <td id="LC1852" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">struct</span> glob_pattern *</td> </tr> <tr> <td id="L1853" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1853"></td> <td id="LC1853" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_make_pattern</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *p, <span class="pl-k">const</span> <span class="pl-k">char</span> *e, <span class="pl-k">int</span> flags, rb_encoding *enc)</td> </tr> <tr> <td id="L1854" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1854"></td> <td id="LC1854" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1855" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1855"></td> <td id="LC1855" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *list, *tmp, **tail = &list;</td> </tr> <tr> <td id="L1856" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1856"></td> <td id="LC1856" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> dirsep = <span class="pl-c1">0</span>; <span class="pl-c"><span class="pl-c">/*</span> pattern is terminated with '/' <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1857" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1857"></td> <td id="LC1857" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> recursive = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1858" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1858"></td> <td id="LC1858" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1859" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1859"></td> <td id="LC1859" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (p < e && *p) {</td> </tr> <tr> <td id="L1860" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1860"></td> <td id="LC1860" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">GLOB_ALLOC</span>(<span class="pl-k">struct</span> glob_pattern);</td> </tr> <tr> <td id="L1861" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1861"></td> <td id="LC1861" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!tmp) <span class="pl-k">goto</span> error;</td> </tr> <tr> <td id="L1862" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1862"></td> <td id="LC1862" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (p + <span class="pl-c1">2</span> < e && p[<span class="pl-c1">0</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">1</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">2</span>] == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L1863" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1863"></td> <td id="LC1863" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> fold continuous RECURSIVEs (needed in glob_helper) <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L1864" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1864"></td> <td id="LC1864" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">do</span> { p += <span class="pl-c1">3</span>; <span class="pl-k">while</span> (*p == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>) p++; } <span class="pl-k">while</span> (p[<span class="pl-c1">0</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">1</span>] == <span class="pl-s"><span class="pl-pds">'</span>*<span class="pl-pds">'</span></span> && p[<span class="pl-c1">2</span>] == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>);</td> </tr> <tr> <td id="L1865" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1865"></td> <td id="LC1865" class="blob-code blob-code-inner js-file-line"> tmp-><span class="pl-smi">type</span> = RECURSIVE;</td> </tr> <tr> <td id="L1866" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1866"></td> <td id="LC1866" class="blob-code blob-code-inner js-file-line"> tmp-><span class="pl-smi">str</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1867" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1867"></td> <td id="LC1867" class="blob-code blob-code-inner js-file-line"> dirsep = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1868" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1868"></td> <td id="LC1868" class="blob-code blob-code-inner js-file-line"> recursive = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1869" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1869"></td> <td id="LC1869" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1870" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1870"></td> <td id="LC1870" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1871" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1871"></td> <td id="LC1871" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *m = <span class="pl-c1">find_dirsep</span>(p, e, flags, enc);</td> </tr> <tr> <td id="L1872" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1872"></td> <td id="LC1872" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">enum</span> glob_pattern_type magic = <span class="pl-c1">has_magic</span>(p, m, flags, enc);</td> </tr> <tr> <td id="L1873" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1873"></td> <td id="LC1873" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">enum</span> glob_pattern_type non_magic = (USE_NAME_ON_FS || FNM_SYSCASE) ? PLAIN : ALPHA;</td> </tr> <tr> <td id="L1874" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1874"></td> <td id="LC1874" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf;</td> </tr> <tr> <td id="L1875" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1875"></td> <td id="LC1875" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1876" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1876"></td> <td id="LC1876" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!(FNM_SYSCASE || magic > non_magic) && !recursive && *m) {</td> </tr> <tr> <td id="L1877" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1877"></td> <td id="LC1877" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *m2;</td> </tr> <tr> <td id="L1878" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1878"></td> <td id="LC1878" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (<span class="pl-c1">has_magic</span>(m+<span class="pl-c1">1</span>, m2 = <span class="pl-c1">find_dirsep</span>(m+<span class="pl-c1">1</span>, e, flags, enc), flags, enc) <= non_magic &&</td> </tr> <tr> <td id="L1879" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1879"></td> <td id="LC1879" class="blob-code blob-code-inner js-file-line"> *m2) {</td> </tr> <tr> <td id="L1880" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1880"></td> <td id="LC1880" class="blob-code blob-code-inner js-file-line"> m = m2;</td> </tr> <tr> <td id="L1881" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1881"></td> <td id="LC1881" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1882" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1882"></td> <td id="LC1882" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1883" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1883"></td> <td id="LC1883" class="blob-code blob-code-inner js-file-line"> buf = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">char</span>, m-p+<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L1884" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1884"></td> <td id="LC1884" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!buf) {</td> </tr> <tr> <td id="L1885" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1885"></td> <td id="LC1885" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(tmp);</td> </tr> <tr> <td id="L1886" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1886"></td> <td id="LC1886" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> error;</td> </tr> <tr> <td id="L1887" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1887"></td> <td id="LC1887" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1888" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1888"></td> <td id="LC1888" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(buf, p, m-p);</td> </tr> <tr> <td id="L1889" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1889"></td> <td id="LC1889" class="blob-code blob-code-inner js-file-line"> buf[m-p] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L1890" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1890"></td> <td id="LC1890" class="blob-code blob-code-inner js-file-line"> tmp-><span class="pl-smi">type</span> = magic > MAGICAL ? MAGICAL : magic > non_magic ? magic : PLAIN;</td> </tr> <tr> <td id="L1891" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1891"></td> <td id="LC1891" class="blob-code blob-code-inner js-file-line"> tmp-><span class="pl-smi">str</span> = buf;</td> </tr> <tr> <td id="L1892" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1892"></td> <td id="LC1892" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*m) {</td> </tr> <tr> <td id="L1893" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1893"></td> <td id="LC1893" class="blob-code blob-code-inner js-file-line"> dirsep = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1894" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1894"></td> <td id="LC1894" class="blob-code blob-code-inner js-file-line"> p = m + <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1895" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1895"></td> <td id="LC1895" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1896" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1896"></td> <td id="LC1896" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L1897" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1897"></td> <td id="LC1897" class="blob-code blob-code-inner js-file-line"> dirsep = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1898" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1898"></td> <td id="LC1898" class="blob-code blob-code-inner js-file-line"> p = m;</td> </tr> <tr> <td id="L1899" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1899"></td> <td id="LC1899" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1900" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1900"></td> <td id="LC1900" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1901" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1901"></td> <td id="LC1901" class="blob-code blob-code-inner js-file-line"> *tail = tmp;</td> </tr> <tr> <td id="L1902" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1902"></td> <td id="LC1902" class="blob-code blob-code-inner js-file-line"> tail = &tmp-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L1903" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1903"></td> <td id="LC1903" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1904" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1904"></td> <td id="LC1904" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1905" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1905"></td> <td id="LC1905" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">GLOB_ALLOC</span>(<span class="pl-k">struct</span> glob_pattern);</td> </tr> <tr> <td id="L1906" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1906"></td> <td id="LC1906" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!tmp) {</td> </tr> <tr> <td id="L1907" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1907"></td> <td id="LC1907" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> error;</td> </tr> <tr> <td id="L1908" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1908"></td> <td id="LC1908" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1909" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1909"></td> <td id="LC1909" class="blob-code blob-code-inner js-file-line"> tmp-><span class="pl-smi">type</span> = dirsep ? MATCH_DIR : MATCH_ALL;</td> </tr> <tr> <td id="L1910" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1910"></td> <td id="LC1910" class="blob-code blob-code-inner js-file-line"> tmp-><span class="pl-smi">str</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1911" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1911"></td> <td id="LC1911" class="blob-code blob-code-inner js-file-line"> *tail = tmp;</td> </tr> <tr> <td id="L1912" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1912"></td> <td id="LC1912" class="blob-code blob-code-inner js-file-line"> tmp-><span class="pl-smi">next</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1913" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1913"></td> <td id="LC1913" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1914" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1914"></td> <td id="LC1914" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> list;</td> </tr> <tr> <td id="L1915" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1915"></td> <td id="LC1915" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1916" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1916"></td> <td id="LC1916" class="blob-code blob-code-inner js-file-line"> error:</td> </tr> <tr> <td id="L1917" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1917"></td> <td id="LC1917" class="blob-code blob-code-inner js-file-line"> *tail = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1918" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1918"></td> <td id="LC1918" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">glob_free_pattern</span>(list);</td> </tr> <tr> <td id="L1919" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1919"></td> <td id="LC1919" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1920" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1920"></td> <td id="LC1920" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1921" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1921"></td> <td id="LC1921" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1922" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1922"></td> <td id="LC1922" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L1923" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1923"></td> <td id="LC1923" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_free_pattern</span>(<span class="pl-k">struct</span> glob_pattern *list)</td> </tr> <tr> <td id="L1924" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1924"></td> <td id="LC1924" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1925" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1925"></td> <td id="LC1925" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (list) {</td> </tr> <tr> <td id="L1926" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1926"></td> <td id="LC1926" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *tmp = list;</td> </tr> <tr> <td id="L1927" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1927"></td> <td id="LC1927" class="blob-code blob-code-inner js-file-line"> list = list-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L1928" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1928"></td> <td id="LC1928" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (tmp-><span class="pl-smi">str</span>)</td> </tr> <tr> <td id="L1929" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1929"></td> <td id="LC1929" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(tmp-><span class="pl-smi">str</span>);</td> </tr> <tr> <td id="L1930" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1930"></td> <td id="LC1930" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(tmp);</td> </tr> <tr> <td id="L1931" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1931"></td> <td id="LC1931" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1932" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1932"></td> <td id="LC1932" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1933" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1933"></td> <td id="LC1933" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1934" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1934"></td> <td id="LC1934" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">char</span> *</td> </tr> <tr> <td id="L1935" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1935"></td> <td id="LC1935" class="blob-code blob-code-inner js-file-line"><span class="pl-en">join_path</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-c1">size_t</span> len, <span class="pl-k">int</span> dirsep, <span class="pl-k">const</span> <span class="pl-k">char</span> *name, <span class="pl-c1">size_t</span> namlen)</td> </tr> <tr> <td id="L1936" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1936"></td> <td id="LC1936" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1937" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1937"></td> <td id="LC1937" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">char</span>, len+namlen+(dirsep?<span class="pl-c1">1</span>:<span class="pl-c1">0</span>)+<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L1938" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1938"></td> <td id="LC1938" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1939" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1939"></td> <td id="LC1939" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!buf) <span class="pl-k">return</span> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1940" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1940"></td> <td id="LC1940" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(buf, path, len);</td> </tr> <tr> <td id="L1941" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1941"></td> <td id="LC1941" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dirsep) {</td> </tr> <tr> <td id="L1942" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1942"></td> <td id="LC1942" class="blob-code blob-code-inner js-file-line"> buf[len++] = <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L1943" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1943"></td> <td id="LC1943" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L1944" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1944"></td> <td id="LC1944" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(buf+len, name, namlen);</td> </tr> <tr> <td id="L1945" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1945"></td> <td id="LC1945" class="blob-code blob-code-inner js-file-line"> buf[len+namlen] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L1946" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1946"></td> <td id="LC1946" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> buf;</td> </tr> <tr> <td id="L1947" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1947"></td> <td id="LC1947" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1948" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1948"></td> <td id="LC1948" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1949" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1949"></td> <td id="LC1949" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_GETATTRLIST</td> </tr> <tr> <td id="L1950" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1950"></td> <td id="LC1950" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined HAVE_FGETATTRLIST</td> </tr> <tr> <td id="L1951" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1951"></td> <td id="LC1951" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">is_case_sensitive</span>(<span class="pl-v">dirp, path</span>) is_case_sensitive(dirp)</td> </tr> <tr> <td id="L1952" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1952"></td> <td id="LC1952" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">else</span></td> </tr> <tr> <td id="L1953" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1953"></td> <td id="LC1953" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">is_case_sensitive</span>(<span class="pl-v">dirp, path</span>) is_case_sensitive(path)</td> </tr> <tr> <td id="L1954" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1954"></td> <td id="LC1954" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L1955" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1955"></td> <td id="LC1955" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L1956" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1956"></td> <td id="LC1956" class="blob-code blob-code-inner js-file-line"><span class="pl-en">is_case_sensitive</span>(DIR *dirp, <span class="pl-k">const</span> <span class="pl-k">char</span> *path)</td> </tr> <tr> <td id="L1957" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1957"></td> <td id="LC1957" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1958" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1958"></td> <td id="LC1958" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> {</td> </tr> <tr> <td id="L1959" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1959"></td> <td id="LC1959" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">u_int32_t</span> length;</td> </tr> <tr> <td id="L1960" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1960"></td> <td id="LC1960" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">vol_capabilities_attr_t</span> cap[<span class="pl-c1">1</span>];</td> </tr> <tr> <td id="L1961" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1961"></td> <td id="LC1961" class="blob-code blob-code-inner js-file-line"> } <span class="pl-c1">__attribute__</span>((<span class="pl-c1">aligned</span>(<span class="pl-c1">4</span>), packed)) attrbuf[<span class="pl-c1">1</span>];</td> </tr> <tr> <td id="L1962" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1962"></td> <td id="LC1962" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> attrlist al = {ATTR_BIT_MAP_COUNT, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>, ATTR_VOL_INFO|ATTR_VOL_CAPABILITIES};</td> </tr> <tr> <td id="L1963" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1963"></td> <td id="LC1963" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">vol_capabilities_attr_t</span> *<span class="pl-k">const</span> cap = attrbuf[<span class="pl-c1">0</span>].<span class="pl-smi">cap</span>;</td> </tr> <tr> <td id="L1964" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1964"></td> <td id="LC1964" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> idx = VOL_CAPABILITIES_FORMAT;</td> </tr> <tr> <td id="L1965" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1965"></td> <td id="LC1965" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">uint32_t</span> mask = VOL_CAP_FMT_CASE_SENSITIVE;</td> </tr> <tr> <td id="L1966" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1966"></td> <td id="LC1966" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1967" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1967"></td> <td id="LC1967" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> defined HAVE_FGETATTRLIST</td> </tr> <tr> <td id="L1968" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1968"></td> <td id="LC1968" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">fgetattrlist</span>(<span class="pl-c1">dirfd</span>(dirp), &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), FSOPT_NOFOLLOW))</td> </tr> <tr> <td id="L1969" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1969"></td> <td id="LC1969" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1970" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1970"></td> <td id="LC1970" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">else</span></td> </tr> <tr> <td id="L1971" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1971"></td> <td id="LC1971" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">getattrlist</span>(path, &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), FSOPT_NOFOLLOW))</td> </tr> <tr> <td id="L1972" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1972"></td> <td id="LC1972" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1973" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1973"></td> <td id="LC1973" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L1974" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1974"></td> <td id="LC1974" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!(cap-><span class="pl-smi">valid</span>[idx] & mask))</td> </tr> <tr> <td id="L1975" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1975"></td> <td id="LC1975" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L1976" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1976"></td> <td id="LC1976" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (cap-><span class="pl-smi">capabilities</span>[idx] & mask) != <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L1977" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1977"></td> <td id="LC1977" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L1978" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1978"></td> <td id="LC1978" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1979" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1979"></td> <td id="LC1979" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">char</span> *</td> </tr> <tr> <td id="L1980" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1980"></td> <td id="LC1980" class="blob-code blob-code-inner js-file-line"><span class="pl-en">replace_real_basename</span>(<span class="pl-k">char</span> *path, <span class="pl-k">long</span> base, rb_encoding *enc, <span class="pl-k">int</span> norm_p, <span class="pl-k">int</span> flags, <span class="pl-c1">rb_pathtype_t</span> *type)</td> </tr> <tr> <td id="L1981" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1981"></td> <td id="LC1981" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L1982" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1982"></td> <td id="LC1982" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> {</td> </tr> <tr> <td id="L1983" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1983"></td> <td id="LC1983" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">u_int32_t</span> length;</td> </tr> <tr> <td id="L1984" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1984"></td> <td id="LC1984" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">attrreference_t</span> ref[<span class="pl-c1">1</span>];</td> </tr> <tr> <td id="L1985" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1985"></td> <td id="LC1985" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">fsobj_type_t</span> objtype;</td> </tr> <tr> <td id="L1986" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1986"></td> <td id="LC1986" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> path[MAXPATHLEN * <span class="pl-c1">3</span>];</td> </tr> <tr> <td id="L1987" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1987"></td> <td id="LC1987" class="blob-code blob-code-inner js-file-line"> } <span class="pl-c1">__attribute__</span>((<span class="pl-c1">aligned</span>(<span class="pl-c1">4</span>), packed)) attrbuf[<span class="pl-c1">1</span>];</td> </tr> <tr> <td id="L1988" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1988"></td> <td id="LC1988" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> attrlist al = {ATTR_BIT_MAP_COUNT, <span class="pl-c1">0</span>, ATTR_CMN_NAME|ATTR_CMN_OBJTYPE};</td> </tr> <tr> <td id="L1989" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1989"></td> <td id="LC1989" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">attrreference_t</span> *<span class="pl-k">const</span> ar = attrbuf[<span class="pl-c1">0</span>].<span class="pl-smi">ref</span>;</td> </tr> <tr> <td id="L1990" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1990"></td> <td id="LC1990" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *name;</td> </tr> <tr> <td id="L1991" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1991"></td> <td id="LC1991" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> len;</td> </tr> <tr> <td id="L1992" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1992"></td> <td id="LC1992" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *tmp;</td> </tr> <tr> <td id="L1993" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1993"></td> <td id="LC1993" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(VALUE utf8str = Qnil);</td> </tr> <tr> <td id="L1994" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1994"></td> <td id="LC1994" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L1995" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1995"></td> <td id="LC1995" class="blob-code blob-code-inner js-file-line"> *type = path_noent;</td> </tr> <tr> <td id="L1996" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1996"></td> <td id="LC1996" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">getattrlist</span>(path, &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), FSOPT_NOFOLLOW)) {</td> </tr> <tr> <td id="L1997" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1997"></td> <td id="LC1997" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">to_be_ignored</span>(errno))</td> </tr> <tr> <td id="L1998" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1998"></td> <td id="LC1998" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">sys_warning</span>(path, enc);</td> </tr> <tr> <td id="L1999" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="1999"></td> <td id="LC1999" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> path;</td> </tr> <tr> <td id="L2000" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2000"></td> <td id="LC2000" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2001" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2001"></td> <td id="LC2001" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2002" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2002"></td> <td id="LC2002" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (attrbuf[<span class="pl-c1">0</span>].<span class="pl-smi">objtype</span>) {</td> </tr> <tr> <td id="L2003" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2003"></td> <td id="LC2003" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> VREG: *type = path_regular; <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2004" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2004"></td> <td id="LC2004" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> VDIR: *type = path_directory; <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2005" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2005"></td> <td id="LC2005" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> VLNK: *type = path_symlink; <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2006" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2006"></td> <td id="LC2006" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>: *type = path_exist; <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2007" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2007"></td> <td id="LC2007" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2008" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2008"></td> <td id="LC2008" class="blob-code blob-code-inner js-file-line"> name = (<span class="pl-k">char</span> *)ar + ar-><span class="pl-smi">attr_dataoffset</span>;</td> </tr> <tr> <td id="L2009" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2009"></td> <td id="LC2009" class="blob-code blob-code-inner js-file-line"> len = (<span class="pl-k">long</span>)ar-><span class="pl-smi">attr_length</span> - <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2010" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2010"></td> <td id="LC2010" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (name + len > (<span class="pl-k">char</span> *)attrbuf + <span class="pl-k">sizeof</span>(attrbuf))</td> </tr> <tr> <td id="L2011" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2011"></td> <td id="LC2011" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> path;</td> </tr> <tr> <td id="L2012" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2012"></td> <td id="LC2012" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2013" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2013"></td> <td id="LC2013" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> NORMALIZE_UTF8PATH</td> </tr> <tr> <td id="L2014" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2014"></td> <td id="LC2014" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (norm_p && <span class="pl-c1">has_nonascii</span>(name, len)) {</td> </tr> <tr> <td id="L2015" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2015"></td> <td id="LC2015" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">NIL_P</span>(utf8str = <span class="pl-c1">rb_str_normalize_ospath</span>(name, len))) {</td> </tr> <tr> <td id="L2016" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2016"></td> <td id="LC2016" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RSTRING_GETMEM</span>(utf8str, name, len);</td> </tr> <tr> <td id="L2017" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2017"></td> <td id="LC2017" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2018" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2018"></td> <td id="LC2018" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2019" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2019"></td> <td id="LC2019" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2020" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2020"></td> <td id="LC2020" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2021" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2021"></td> <td id="LC2021" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">GLOB_REALLOC</span>(path, base + len + <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L2022" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2022"></td> <td id="LC2022" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (tmp) {</td> </tr> <tr> <td id="L2023" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2023"></td> <td id="LC2023" class="blob-code blob-code-inner js-file-line"> path = tmp;</td> </tr> <tr> <td id="L2024" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2024"></td> <td id="LC2024" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(path + base, name, len);</td> </tr> <tr> <td id="L2025" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2025"></td> <td id="LC2025" class="blob-code blob-code-inner js-file-line"> path[base + len] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L2026" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2026"></td> <td id="LC2026" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2027" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2027"></td> <td id="LC2027" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(<span class="pl-k">if</span> (!<span class="pl-c1">NIL_P</span>(utf8str)) <span class="pl-c1">rb_str_resize</span>(utf8str, <span class="pl-c1">0</span>));</td> </tr> <tr> <td id="L2028" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2028"></td> <td id="LC2028" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> path;</td> </tr> <tr> <td id="L2029" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2029"></td> <td id="LC2029" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2030" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2030"></td> <td id="LC2030" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">elif</span> defined _WIN32</td> </tr> <tr> <td id="L2031" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2031"></td> <td id="LC2031" class="blob-code blob-code-inner js-file-line">VALUE <span class="pl-en">rb_w32_conv_from_wchar</span>(<span class="pl-k">const</span> WCHAR *wstr, rb_encoding *enc);</td> </tr> <tr> <td id="L2032" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2032"></td> <td id="LC2032" class="blob-code blob-code-inner js-file-line"><span class="pl-k">int</span> <span class="pl-en">rb_w32_reparse_symlink_p</span>(<span class="pl-k">const</span> WCHAR *path);</td> </tr> <tr> <td id="L2033" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2033"></td> <td id="LC2033" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2034" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2034"></td> <td id="LC2034" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">char</span> *</td> </tr> <tr> <td id="L2035" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2035"></td> <td id="LC2035" class="blob-code blob-code-inner js-file-line"><span class="pl-en">replace_real_basename</span>(<span class="pl-k">char</span> *path, <span class="pl-k">long</span> base, rb_encoding *enc, <span class="pl-k">int</span> norm_p, <span class="pl-k">int</span> flags, <span class="pl-c1">rb_pathtype_t</span> *type)</td> </tr> <tr> <td id="L2036" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2036"></td> <td id="LC2036" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2037" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2037"></td> <td id="LC2037" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *plainname = path;</td> </tr> <tr> <td id="L2038" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2038"></td> <td id="LC2038" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">volatile</span> VALUE tmp = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2039" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2039"></td> <td id="LC2039" class="blob-code blob-code-inner js-file-line"> WIN32_FIND_DATAW fd;</td> </tr> <tr> <td id="L2040" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2040"></td> <td id="LC2040" class="blob-code blob-code-inner js-file-line"> WIN32_FILE_ATTRIBUTE_DATA fa;</td> </tr> <tr> <td id="L2041" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2041"></td> <td id="LC2041" class="blob-code blob-code-inner js-file-line"> WCHAR *wplain;</td> </tr> <tr> <td id="L2042" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2042"></td> <td id="LC2042" class="blob-code blob-code-inner js-file-line"> HANDLE h = INVALID_HANDLE_VALUE;</td> </tr> <tr> <td id="L2043" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2043"></td> <td id="LC2043" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> wlen;</td> </tr> <tr> <td id="L2044" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2044"></td> <td id="LC2044" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> e = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2045" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2045"></td> <td id="LC2045" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">fundamental_encoding_p</span>(enc)) {</td> </tr> <tr> <td id="L2046" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2046"></td> <td id="LC2046" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">rb_enc_str_new_cstr</span>(plainname, enc);</td> </tr> <tr> <td id="L2047" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2047"></td> <td id="LC2047" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">rb_str_encode_ospath</span>(tmp);</td> </tr> <tr> <td id="L2048" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2048"></td> <td id="LC2048" class="blob-code blob-code-inner js-file-line"> plainname = <span class="pl-c1">RSTRING_PTR</span>(tmp);</td> </tr> <tr> <td id="L2049" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2049"></td> <td id="LC2049" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2050" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2050"></td> <td id="LC2050" class="blob-code blob-code-inner js-file-line"> wplain = <span class="pl-c1">rb_w32_mbstr_to_wstr</span>(CP_UTF8, plainname, -<span class="pl-c1">1</span>, &wlen);</td> </tr> <tr> <td id="L2051" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2051"></td> <td id="LC2051" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (tmp) <span class="pl-c1">rb_str_resize</span>(tmp, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L2052" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2052"></td> <td id="LC2052" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!wplain) <span class="pl-k">return</span> path;</td> </tr> <tr> <td id="L2053" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2053"></td> <td id="LC2053" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">GetFileAttributesExW</span>(wplain, GetFileExInfoStandard, &fa)) {</td> </tr> <tr> <td id="L2054" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2054"></td> <td id="LC2054" class="blob-code blob-code-inner js-file-line"> h = <span class="pl-c1">FindFirstFileW</span>(wplain, &fd);</td> </tr> <tr> <td id="L2055" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2055"></td> <td id="LC2055" class="blob-code blob-code-inner js-file-line"> e = <span class="pl-c1">rb_w32_map_errno</span>(<span class="pl-c1">GetLastError</span>());</td> </tr> <tr> <td id="L2056" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2056"></td> <td id="LC2056" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2057" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2057"></td> <td id="LC2057" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (fa.<span class="pl-smi">dwFileAttributes</span> & FILE_ATTRIBUTE_REPARSE_POINT) {</td> </tr> <tr> <td id="L2058" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2058"></td> <td id="LC2058" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">rb_w32_reparse_symlink_p</span>(wplain))</td> </tr> <tr> <td id="L2059" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2059"></td> <td id="LC2059" class="blob-code blob-code-inner js-file-line"> fa.<span class="pl-smi">dwFileAttributes</span> &= ~FILE_ATTRIBUTE_REPARSE_POINT;</td> </tr> <tr> <td id="L2060" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2060"></td> <td id="LC2060" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2061" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2061"></td> <td id="LC2061" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">free</span>(wplain);</td> </tr> <tr> <td id="L2062" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2062"></td> <td id="LC2062" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (h == INVALID_HANDLE_VALUE) {</td> </tr> <tr> <td id="L2063" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2063"></td> <td id="LC2063" class="blob-code blob-code-inner js-file-line"> *type = path_noent;</td> </tr> <tr> <td id="L2064" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2064"></td> <td id="LC2064" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (e && !<span class="pl-c1">to_be_ignored</span>(e)) {</td> </tr> <tr> <td id="L2065" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2065"></td> <td id="LC2065" class="blob-code blob-code-inner js-file-line"> errno = e;</td> </tr> <tr> <td id="L2066" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2066"></td> <td id="LC2066" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">sys_warning</span>(path, enc);</td> </tr> <tr> <td id="L2067" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2067"></td> <td id="LC2067" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2068" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2068"></td> <td id="LC2068" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> path;</td> </tr> <tr> <td id="L2069" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2069"></td> <td id="LC2069" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2070" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2070"></td> <td id="LC2070" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FindClose</span>(h);</td> </tr> <tr> <td id="L2071" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2071"></td> <td id="LC2071" class="blob-code blob-code-inner js-file-line"> *type =</td> </tr> <tr> <td id="L2072" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2072"></td> <td id="LC2072" class="blob-code blob-code-inner js-file-line"> (fa.<span class="pl-smi">dwFileAttributes</span> & FILE_ATTRIBUTE_REPARSE_POINT) ? path_symlink :</td> </tr> <tr> <td id="L2073" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2073"></td> <td id="LC2073" class="blob-code blob-code-inner js-file-line"> (fa.<span class="pl-smi">dwFileAttributes</span> & FILE_ATTRIBUTE_DIRECTORY) ? path_directory :</td> </tr> <tr> <td id="L2074" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2074"></td> <td id="LC2074" class="blob-code blob-code-inner js-file-line"> path_regular;</td> </tr> <tr> <td id="L2075" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2075"></td> <td id="LC2075" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (tmp) {</td> </tr> <tr> <td id="L2076" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2076"></td> <td id="LC2076" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf;</td> </tr> <tr> <td id="L2077" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2077"></td> <td id="LC2077" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">rb_w32_conv_from_wchar</span>(fd.<span class="pl-smi">cFileName</span>, enc);</td> </tr> <tr> <td id="L2078" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2078"></td> <td id="LC2078" class="blob-code blob-code-inner js-file-line"> wlen = <span class="pl-c1">RSTRING_LEN</span>(tmp);</td> </tr> <tr> <td id="L2079" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2079"></td> <td id="LC2079" class="blob-code blob-code-inner js-file-line"> buf = <span class="pl-c1">GLOB_REALLOC</span>(path, base + wlen + <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L2080" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2080"></td> <td id="LC2080" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (buf) {</td> </tr> <tr> <td id="L2081" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2081"></td> <td id="LC2081" class="blob-code blob-code-inner js-file-line"> path = buf;</td> </tr> <tr> <td id="L2082" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2082"></td> <td id="LC2082" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(path + base, <span class="pl-c1">RSTRING_PTR</span>(tmp), wlen);</td> </tr> <tr> <td id="L2083" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2083"></td> <td id="LC2083" class="blob-code blob-code-inner js-file-line"> path[base + wlen] = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2084" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2084"></td> <td id="LC2084" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2085" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2085"></td> <td id="LC2085" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_str_resize</span>(tmp, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L2086" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2086"></td> <td id="LC2086" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2087" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2087"></td> <td id="LC2087" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2088" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2088"></td> <td id="LC2088" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *utf8filename;</td> </tr> <tr> <td id="L2089" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2089"></td> <td id="LC2089" class="blob-code blob-code-inner js-file-line"> wlen = <span class="pl-c1">WideCharToMultiByte</span>(CP_UTF8, <span class="pl-c1">0</span>, fd.<span class="pl-smi">cFileName</span>, -<span class="pl-c1">1</span>, <span class="pl-c1">NULL</span>, <span class="pl-c1">0</span>, <span class="pl-c1">NULL</span>, <span class="pl-c1">NULL</span>);</td> </tr> <tr> <td id="L2090" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2090"></td> <td id="LC2090" class="blob-code blob-code-inner js-file-line"> utf8filename = <span class="pl-c1">GLOB_REALLOC</span>(<span class="pl-c1">0</span>, wlen);</td> </tr> <tr> <td id="L2091" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2091"></td> <td id="LC2091" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (utf8filename) {</td> </tr> <tr> <td id="L2092" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2092"></td> <td id="LC2092" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf;</td> </tr> <tr> <td id="L2093" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2093"></td> <td id="LC2093" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">WideCharToMultiByte</span>(CP_UTF8, <span class="pl-c1">0</span>, fd.<span class="pl-smi">cFileName</span>, -<span class="pl-c1">1</span>, utf8filename, wlen, <span class="pl-c1">NULL</span>, <span class="pl-c1">NULL</span>);</td> </tr> <tr> <td id="L2094" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2094"></td> <td id="LC2094" class="blob-code blob-code-inner js-file-line"> buf = <span class="pl-c1">GLOB_REALLOC</span>(path, base + wlen + <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L2095" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2095"></td> <td id="LC2095" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (buf) {</td> </tr> <tr> <td id="L2096" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2096"></td> <td id="LC2096" class="blob-code blob-code-inner js-file-line"> path = buf;</td> </tr> <tr> <td id="L2097" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2097"></td> <td id="LC2097" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(path + base, utf8filename, wlen);</td> </tr> <tr> <td id="L2098" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2098"></td> <td id="LC2098" class="blob-code blob-code-inner js-file-line"> path[base + wlen] = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2099" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2099"></td> <td id="LC2099" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2100" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2100"></td> <td id="LC2100" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(utf8filename);</td> </tr> <tr> <td id="L2101" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2101"></td> <td id="LC2101" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2102" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2102"></td> <td id="LC2102" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2103" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2103"></td> <td id="LC2103" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> path;</td> </tr> <tr> <td id="L2104" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2104"></td> <td id="LC2104" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2105" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2105"></td> <td id="LC2105" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">elif</span> USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME</td> </tr> <tr> <td id="L2106" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2106"></td> <td id="LC2106" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">error</span> not implemented</td> </tr> <tr> <td id="L2107" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2107"></td> <td id="LC2107" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2108" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2108"></td> <td id="LC2108" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2109" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2109"></td> <td id="LC2109" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> S_ISDIR</td> </tr> <tr> <td id="L2110" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2110"></td> <td id="LC2110" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">S_ISDIR</span>(<span class="pl-v">m</span>) (((m) & S_IFMT) == S_IFDIR)</td> </tr> <tr> <td id="L2111" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2111"></td> <td id="LC2111" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2112" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2112"></td> <td id="LC2112" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2113" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2113"></td> <td id="LC2113" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifndef</span> S_ISLNK</td> </tr> <tr> <td id="L2114" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2114"></td> <td id="LC2114" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">ifndef</span> S_IFLNK</td> </tr> <tr> <td id="L2115" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2115"></td> <td id="LC2115" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">S_ISLNK</span>(<span class="pl-v">m</span>) (<span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L2116" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2116"></td> <td id="LC2116" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">else</span></td> </tr> <tr> <td id="L2117" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2117"></td> <td id="LC2117" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">define</span> <span class="pl-en">S_ISLNK</span>(<span class="pl-v">m</span>) (((m) & S_IFMT) == S_IFLNK)</td> </tr> <tr> <td id="L2118" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2118"></td> <td id="LC2118" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2119" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2119"></td> <td id="LC2119" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2120" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2120"></td> <td id="LC2120" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2121" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2121"></td> <td id="LC2121" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> glob_args {</td> </tr> <tr> <td id="L2122" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2122"></td> <td id="LC2122" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">void</span> (*func)(<span class="pl-k">const</span> <span class="pl-k">char</span> *, VALUE, <span class="pl-k">void</span> *);</td> </tr> <tr> <td id="L2123" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2123"></td> <td id="LC2123" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L2124" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2124"></td> <td id="LC2124" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *base;</td> </tr> <tr> <td id="L2125" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2125"></td> <td id="LC2125" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> baselen;</td> </tr> <tr> <td id="L2126" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2126"></td> <td id="LC2126" class="blob-code blob-code-inner js-file-line"> VALUE value;</td> </tr> <tr> <td id="L2127" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2127"></td> <td id="LC2127" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc;</td> </tr> <tr> <td id="L2128" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2128"></td> <td id="LC2128" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L2129" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2129"></td> <td id="LC2129" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2130" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2130"></td> <td id="LC2130" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">define</span> <span class="pl-en">glob_call_func</span>(<span class="pl-v">func, path, arg, enc</span>) (*(func))((path), (arg), (<span class="pl-k">void</span> *)(enc))</td> </tr> <tr> <td id="L2131" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2131"></td> <td id="LC2131" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2132" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2132"></td> <td id="LC2132" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L2133" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2133"></td> <td id="LC2133" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_func_caller</span>(VALUE val)</td> </tr> <tr> <td id="L2134" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2134"></td> <td id="LC2134" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2135" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2135"></td> <td id="LC2135" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_args *args = (<span class="pl-k">struct</span> glob_args *)val;</td> </tr> <tr> <td id="L2136" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2136"></td> <td id="LC2136" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2137" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2137"></td> <td id="LC2137" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">glob_call_func</span>(args-><span class="pl-smi">func</span>, args-><span class="pl-smi">path</span>, args-><span class="pl-smi">value</span>, args-><span class="pl-smi">enc</span>);</td> </tr> <tr> <td id="L2138" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2138"></td> <td id="LC2138" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L2139" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2139"></td> <td id="LC2139" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2140" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2140"></td> <td id="LC2140" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2141" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2141"></td> <td id="LC2141" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> glob_error_args {</td> </tr> <tr> <td id="L2142" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2142"></td> <td id="LC2142" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L2143" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2143"></td> <td id="LC2143" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc;</td> </tr> <tr> <td id="L2144" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2144"></td> <td id="LC2144" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> error;</td> </tr> <tr> <td id="L2145" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2145"></td> <td id="LC2145" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L2146" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2146"></td> <td id="LC2146" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2147" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2147"></td> <td id="LC2147" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L2148" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2148"></td> <td id="LC2148" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_func_warning</span>(VALUE val)</td> </tr> <tr> <td id="L2149" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2149"></td> <td id="LC2149" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2150" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2150"></td> <td id="LC2150" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_error_args *arg = (<span class="pl-k">struct</span> glob_error_args *)val;</td> </tr> <tr> <td id="L2151" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2151"></td> <td id="LC2151" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_syserr_enc_warning</span>(arg-><span class="pl-smi">error</span>, arg-><span class="pl-smi">enc</span>, <span class="pl-s"><span class="pl-pds">"</span><span class="pl-c1">%s</span><span class="pl-pds">"</span></span>, arg-><span class="pl-smi">path</span>);</td> </tr> <tr> <td id="L2152" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2152"></td> <td id="LC2152" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L2153" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2153"></td> <td id="LC2153" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2154" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2154"></td> <td id="LC2154" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2155" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2155"></td> <td id="LC2155" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L2156" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2156"></td> <td id="LC2156" class="blob-code blob-code-inner js-file-line">static int</td> </tr> <tr> <td id="L2157" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2157"></td> <td id="LC2157" class="blob-code blob-code-inner js-file-line">rb_glob_warning(const char *path, VALUE a, const void *enc, int error)</td> </tr> <tr> <td id="L2158" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2158"></td> <td id="LC2158" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2159" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2159"></td> <td id="LC2159" class="blob-code blob-code-inner js-file-line"> int status;</td> </tr> <tr> <td id="L2160" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2160"></td> <td id="LC2160" class="blob-code blob-code-inner js-file-line"> struct glob_error_args args;</td> </tr> <tr> <td id="L2161" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2161"></td> <td id="LC2161" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2162" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2162"></td> <td id="LC2162" class="blob-code blob-code-inner js-file-line"> args.path = path;</td> </tr> <tr> <td id="L2163" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2163"></td> <td id="LC2163" class="blob-code blob-code-inner js-file-line"> args.enc = enc;</td> </tr> <tr> <td id="L2164" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2164"></td> <td id="LC2164" class="blob-code blob-code-inner js-file-line"> args.error = error;</td> </tr> <tr> <td id="L2165" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2165"></td> <td id="LC2165" class="blob-code blob-code-inner js-file-line"> rb_protect(glob_func_warning, (VALUE)&args, &status);</td> </tr> <tr> <td id="L2166" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2166"></td> <td id="LC2166" class="blob-code blob-code-inner js-file-line"> return status;</td> </tr> <tr> <td id="L2167" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2167"></td> <td id="LC2167" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2168" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2168"></td> <td id="LC2168" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2169" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2169"></td> <td id="LC2169" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2170" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2170"></td> <td id="LC2170" class="blob-code blob-code-inner js-file-line"><span class="pl-en">NORETURN</span>(<span class="pl-k">static</span> VALUE <span class="pl-en">glob_func_error</span>(VALUE val));</td> </tr> <tr> <td id="L2171" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2171"></td> <td id="LC2171" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2172" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2172"></td> <td id="LC2172" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L2173" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2173"></td> <td id="LC2173" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_func_error</span>(VALUE val)</td> </tr> <tr> <td id="L2174" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2174"></td> <td id="LC2174" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2175" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2175"></td> <td id="LC2175" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_error_args *arg = (<span class="pl-k">struct</span> glob_error_args *)val;</td> </tr> <tr> <td id="L2176" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2176"></td> <td id="LC2176" class="blob-code blob-code-inner js-file-line"> VALUE path = <span class="pl-c1">rb_enc_str_new_cstr</span>(arg-><span class="pl-smi">path</span>, arg-><span class="pl-smi">enc</span>);</td> </tr> <tr> <td id="L2177" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2177"></td> <td id="LC2177" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_syserr_fail_str</span>(arg-><span class="pl-smi">error</span>, path);</td> </tr> <tr> <td id="L2178" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2178"></td> <td id="LC2178" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">UNREACHABLE_RETURN</span>(Qnil);</td> </tr> <tr> <td id="L2179" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2179"></td> <td id="LC2179" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2180" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2180"></td> <td id="LC2180" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2181" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2181"></td> <td id="LC2181" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2182" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2182"></td> <td id="LC2182" class="blob-code blob-code-inner js-file-line"><span class="pl-en">rb_glob_error</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, VALUE a, <span class="pl-k">const</span> <span class="pl-k">void</span> *enc, <span class="pl-k">int</span> error)</td> </tr> <tr> <td id="L2183" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2183"></td> <td id="LC2183" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2184" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2184"></td> <td id="LC2184" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status;</td> </tr> <tr> <td id="L2185" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2185"></td> <td id="LC2185" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_error_args args;</td> </tr> <tr> <td id="L2186" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2186"></td> <td id="LC2186" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">VALUE</span> (*errfunc)(VALUE) = glob_func_error;</td> </tr> <tr> <td id="L2187" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2187"></td> <td id="LC2187" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2188" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2188"></td> <td id="LC2188" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (error) {</td> </tr> <tr> <td id="L2189" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2189"></td> <td id="LC2189" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> EACCES:</td> </tr> <tr> <td id="L2190" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2190"></td> <td id="LC2190" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> ENOTCAPABLE</td> </tr> <tr> <td id="L2191" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2191"></td> <td id="LC2191" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ENOTCAPABLE:</td> </tr> <tr> <td id="L2192" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2192"></td> <td id="LC2192" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2193" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2193"></td> <td id="LC2193" class="blob-code blob-code-inner js-file-line"> errfunc = glob_func_warning;</td> </tr> <tr> <td id="L2194" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2194"></td> <td id="LC2194" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2195" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2195"></td> <td id="LC2195" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">path</span> = path;</td> </tr> <tr> <td id="L2196" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2196"></td> <td id="LC2196" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">enc</span> = enc;</td> </tr> <tr> <td id="L2197" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2197"></td> <td id="LC2197" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">error</span> = error;</td> </tr> <tr> <td id="L2198" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2198"></td> <td id="LC2198" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_protect</span>(errfunc, (VALUE)&args, &status);</td> </tr> <tr> <td id="L2199" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2199"></td> <td id="LC2199" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2200" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2200"></td> <td id="LC2200" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2201" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2201"></td> <td id="LC2201" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2202" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2202"></td> <td id="LC2202" class="blob-code blob-code-inner js-file-line"><span class="pl-k">typedef</span> <span class="pl-k">struct</span> rb_dirent {</td> </tr> <tr> <td id="L2203" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2203"></td> <td id="LC2203" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> d_namlen;</td> </tr> <tr> <td id="L2204" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2204"></td> <td id="LC2204" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *d_name;</td> </tr> <tr> <td id="L2205" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2205"></td> <td id="LC2205" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L2206" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2206"></td> <td id="LC2206" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *d_altname;</td> </tr> <tr> <td id="L2207" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2207"></td> <td id="LC2207" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2208" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2208"></td> <td id="LC2208" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">uint8_t</span> d_type;</td> </tr> <tr> <td id="L2209" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2209"></td> <td id="LC2209" class="blob-code blob-code-inner js-file-line">} <span class="pl-c1">rb_dirent_t</span>;</td> </tr> <tr> <td id="L2210" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2210"></td> <td id="LC2210" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2211" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2211"></td> <td id="LC2211" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">inline</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2212" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2212"></td> <td id="LC2212" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dirent_match</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *pat, rb_encoding *enc, <span class="pl-k">const</span> <span class="pl-k">char</span> *name, <span class="pl-k">const</span> <span class="pl-c1">rb_dirent_t</span> *dp, <span class="pl-k">int</span> flags)</td> </tr> <tr> <td id="L2213" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2213"></td> <td id="LC2213" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2214" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2214"></td> <td id="LC2214" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">fnmatch</span>(pat, enc, name, flags) == <span class="pl-c1">0</span>) <span class="pl-k">return</span> <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2215" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2215"></td> <td id="LC2215" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L2216" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2216"></td> <td id="LC2216" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dp-><span class="pl-smi">d_altname</span> && (flags & FNM_SHORTNAME)) {</td> </tr> <tr> <td id="L2217" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2217"></td> <td id="LC2217" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">fnmatch</span>(pat, enc, dp-><span class="pl-smi">d_altname</span>, flags) == <span class="pl-c1">0</span>) <span class="pl-k">return</span> <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2218" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2218"></td> <td id="LC2218" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2219" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2219"></td> <td id="LC2219" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2220" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2220"></td> <td id="LC2220" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2221" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2221"></td> <td id="LC2221" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2222" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2222"></td> <td id="LC2222" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2223" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2223"></td> <td id="LC2223" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> push_glob_args {</td> </tr> <tr> <td id="L2224" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2224"></td> <td id="LC2224" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd;</td> </tr> <tr> <td id="L2225" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2225"></td> <td id="LC2225" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L2226" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2226"></td> <td id="LC2226" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> baselen;</td> </tr> <tr> <td id="L2227" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2227"></td> <td id="LC2227" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> namelen;</td> </tr> <tr> <td id="L2228" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2228"></td> <td id="LC2228" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> dirsep; <span class="pl-c"><span class="pl-c">/*</span> '/' should be placed before appending child entry's name to 'path'. <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2229" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2229"></td> <td id="LC2229" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_pathtype_t</span> pathtype; <span class="pl-c"><span class="pl-c">/*</span> type of 'path' <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2230" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2230"></td> <td id="LC2230" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags;</td> </tr> <tr> <td id="L2231" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2231"></td> <td id="LC2231" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">ruby_glob_funcs_t</span> *funcs;</td> </tr> <tr> <td id="L2232" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2232"></td> <td id="LC2232" class="blob-code blob-code-inner js-file-line"> VALUE arg;</td> </tr> <tr> <td id="L2233" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2233"></td> <td id="LC2233" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L2234" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2234"></td> <td id="LC2234" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2235" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2235"></td> <td id="LC2235" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> dirent_brace_args {</td> </tr> <tr> <td id="L2236" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2236"></td> <td id="LC2236" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *name;</td> </tr> <tr> <td id="L2237" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2237"></td> <td id="LC2237" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">rb_dirent_t</span> *dp;</td> </tr> <tr> <td id="L2238" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2238"></td> <td id="LC2238" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags;</td> </tr> <tr> <td id="L2239" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2239"></td> <td id="LC2239" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L2240" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2240"></td> <td id="LC2240" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2241" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2241"></td> <td id="LC2241" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2242" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2242"></td> <td id="LC2242" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dirent_match_brace</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *pattern, VALUE val, <span class="pl-k">void</span> *enc)</td> </tr> <tr> <td id="L2243" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2243"></td> <td id="LC2243" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2244" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2244"></td> <td id="LC2244" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dirent_brace_args *arg = (<span class="pl-k">struct</span> dirent_brace_args *)val;</td> </tr> <tr> <td id="L2245" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2245"></td> <td id="LC2245" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2246" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2246"></td> <td id="LC2246" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">dirent_match</span>(pattern, enc, arg-><span class="pl-smi">name</span>, arg-><span class="pl-smi">dp</span>, arg-><span class="pl-smi">flags</span>);</td> </tr> <tr> <td id="L2247" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2247"></td> <td id="LC2247" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2248" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2248"></td> <td id="LC2248" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2249" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2249"></td> <td id="LC2249" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> join paths from pattern list of glob_make_pattern() <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2250" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2250"></td> <td id="LC2250" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">char</span>*</td> </tr> <tr> <td id="L2251" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2251"></td> <td id="LC2251" class="blob-code blob-code-inner js-file-line"><span class="pl-en">join_path_from_pattern</span>(<span class="pl-k">struct</span> glob_pattern **beg)</td> </tr> <tr> <td id="L2252" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2252"></td> <td id="LC2252" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2253" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2253"></td> <td id="LC2253" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *p;</td> </tr> <tr> <td id="L2254" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2254"></td> <td id="LC2254" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *path = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2255" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2255"></td> <td id="LC2255" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> path_len = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2256" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2256"></td> <td id="LC2256" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2257" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2257"></td> <td id="LC2257" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (p = *beg; p; p = p-><span class="pl-smi">next</span>) {</td> </tr> <tr> <td id="L2258" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2258"></td> <td id="LC2258" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *str;</td> </tr> <tr> <td id="L2259" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2259"></td> <td id="LC2259" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (p-><span class="pl-smi">type</span>) {</td> </tr> <tr> <td id="L2260" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2260"></td> <td id="LC2260" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> RECURSIVE:</td> </tr> <tr> <td id="L2261" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2261"></td> <td id="LC2261" class="blob-code blob-code-inner js-file-line"> str = <span class="pl-s"><span class="pl-pds">"</span>**<span class="pl-pds">"</span></span>;</td> </tr> <tr> <td id="L2262" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2262"></td> <td id="LC2262" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2263" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2263"></td> <td id="LC2263" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> MATCH_DIR:</td> </tr> <tr> <td id="L2264" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2264"></td> <td id="LC2264" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> append last slash <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2265" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2265"></td> <td id="LC2265" class="blob-code blob-code-inner js-file-line"> str = <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>;</td> </tr> <tr> <td id="L2266" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2266"></td> <td id="LC2266" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2267" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2267"></td> <td id="LC2267" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L2268" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2268"></td> <td id="LC2268" class="blob-code blob-code-inner js-file-line"> str = p-><span class="pl-smi">str</span>;</td> </tr> <tr> <td id="L2269" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2269"></td> <td id="LC2269" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!str) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L2270" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2270"></td> <td id="LC2270" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2271" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2271"></td> <td id="LC2271" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!path) {</td> </tr> <tr> <td id="L2272" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2272"></td> <td id="LC2272" class="blob-code blob-code-inner js-file-line"> path_len = <span class="pl-c1">strlen</span>(str);</td> </tr> <tr> <td id="L2273" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2273"></td> <td id="LC2273" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">char</span>, path_len + <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L2274" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2274"></td> <td id="LC2274" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (path) {</td> </tr> <tr> <td id="L2275" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2275"></td> <td id="LC2275" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(path, str, path_len);</td> </tr> <tr> <td id="L2276" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2276"></td> <td id="LC2276" class="blob-code blob-code-inner js-file-line"> path[path_len] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L2277" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2277"></td> <td id="LC2277" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2278" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2278"></td> <td id="LC2278" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2279" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2279"></td> <td id="LC2279" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2280" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2280"></td> <td id="LC2280" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> len = <span class="pl-c1">strlen</span>(str);</td> </tr> <tr> <td id="L2281" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2281"></td> <td id="LC2281" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *tmp;</td> </tr> <tr> <td id="L2282" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2282"></td> <td id="LC2282" class="blob-code blob-code-inner js-file-line"> tmp = <span class="pl-c1">GLOB_REALLOC</span>(path, path_len + len + <span class="pl-c1">2</span>);</td> </tr> <tr> <td id="L2283" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2283"></td> <td id="LC2283" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (tmp) {</td> </tr> <tr> <td id="L2284" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2284"></td> <td id="LC2284" class="blob-code blob-code-inner js-file-line"> path = tmp;</td> </tr> <tr> <td id="L2285" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2285"></td> <td id="LC2285" class="blob-code blob-code-inner js-file-line"> path[path_len++] = <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L2286" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2286"></td> <td id="LC2286" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(path + path_len, str, len);</td> </tr> <tr> <td id="L2287" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2287"></td> <td id="LC2287" class="blob-code blob-code-inner js-file-line"> path_len += len;</td> </tr> <tr> <td id="L2288" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2288"></td> <td id="LC2288" class="blob-code blob-code-inner js-file-line"> path[path_len] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L2289" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2289"></td> <td id="LC2289" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2290" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2290"></td> <td id="LC2290" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2291" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2291"></td> <td id="LC2291" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2292" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2292"></td> <td id="LC2292" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> path;</td> </tr> <tr> <td id="L2293" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2293"></td> <td id="LC2293" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2294" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2294"></td> <td id="LC2294" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2295" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2295"></td> <td id="LC2295" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span> <span class="pl-en">push_caller</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, VALUE val, <span class="pl-k">void</span> *enc);</td> </tr> <tr> <td id="L2296" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2296"></td> <td id="LC2296" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2297" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2297"></td> <td id="LC2297" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span> <span class="pl-en">ruby_brace_expand</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *str, <span class="pl-k">int</span> flags, ruby_glob_func *func, VALUE arg,</td> </tr> <tr> <td id="L2298" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2298"></td> <td id="LC2298" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc, VALUE var);</td> </tr> <tr> <td id="L2299" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2299"></td> <td id="LC2299" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2300" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2300"></td> <td id="LC2300" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">const</span> <span class="pl-c1">size_t</span> rb_dirent_name_offset =</td> </tr> <tr> <td id="L2301" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2301"></td> <td id="LC2301" class="blob-code blob-code-inner js-file-line"> <span class="pl-en">offsetof</span>(<span class="pl-c1">rb_dirent_t</span>, d_type) + sizeof(<span class="pl-c1">uint8_t</span>);</td> </tr> <tr> <td id="L2302" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2302"></td> <td id="LC2302" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2303" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2303"></td> <td id="LC2303" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-c1">rb_dirent_t</span> *</td> </tr> <tr> <td id="L2304" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2304"></td> <td id="LC2304" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dirent_copy</span>(<span class="pl-k">const</span> <span class="pl-k">struct</span> dirent *dp, <span class="pl-c1">rb_dirent_t</span> *rdp)</td> </tr> <tr> <td id="L2305" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2305"></td> <td id="LC2305" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2306" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2306"></td> <td id="LC2306" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dp) <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2307" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2307"></td> <td id="LC2307" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> namlen = <span class="pl-c1">NAMLEN</span>(dp);</td> </tr> <tr> <td id="L2308" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2308"></td> <td id="LC2308" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">size_t</span> altlen =</td> </tr> <tr> <td id="L2309" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2309"></td> <td id="LC2309" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L2310" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2310"></td> <td id="LC2310" class="blob-code blob-code-inner js-file-line"> dp-><span class="pl-smi">d_altlen</span> ? dp-><span class="pl-smi">d_altlen</span> + <span class="pl-c1">1</span> :</td> </tr> <tr> <td id="L2311" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2311"></td> <td id="LC2311" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2312" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2312"></td> <td id="LC2312" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2313" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2313"></td> <td id="LC2313" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_dirent_t</span> *newrdp = rdp;</td> </tr> <tr> <td id="L2314" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2314"></td> <td id="LC2314" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!rdp && !(newrdp = <span class="pl-c1">malloc</span>(rb_dirent_name_offset + namlen + <span class="pl-c1">1</span> + altlen)))</td> </tr> <tr> <td id="L2315" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2315"></td> <td id="LC2315" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2316" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2316"></td> <td id="LC2316" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_namlen</span> = namlen;</td> </tr> <tr> <td id="L2317" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2317"></td> <td id="LC2317" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!rdp) {</td> </tr> <tr> <td id="L2318" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2318"></td> <td id="LC2318" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *name = (<span class="pl-k">char</span> *)newrdp + rb_dirent_name_offset;</td> </tr> <tr> <td id="L2319" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2319"></td> <td id="LC2319" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(name, dp-><span class="pl-smi">d_name</span>, namlen);</td> </tr> <tr> <td id="L2320" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2320"></td> <td id="LC2320" class="blob-code blob-code-inner js-file-line"> name[namlen] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L2321" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2321"></td> <td id="LC2321" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L2322" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2322"></td> <td id="LC2322" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_altname</span> = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2323" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2323"></td> <td id="LC2323" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (altlen) {</td> </tr> <tr> <td id="L2324" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2324"></td> <td id="LC2324" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *<span class="pl-k">const</span> altname = name + namlen + <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2325" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2325"></td> <td id="LC2325" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(altname, dp-><span class="pl-smi">d_altname</span>, altlen - <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L2326" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2326"></td> <td id="LC2326" class="blob-code blob-code-inner js-file-line"> altname[altlen - <span class="pl-c1">1</span>] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L2327" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2327"></td> <td id="LC2327" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_altname</span> = altname;</td> </tr> <tr> <td id="L2328" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2328"></td> <td id="LC2328" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2329" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2329"></td> <td id="LC2329" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2330" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2330"></td> <td id="LC2330" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_name</span> = name;</td> </tr> <tr> <td id="L2331" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2331"></td> <td id="LC2331" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2332" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2332"></td> <td id="LC2332" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2333" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2333"></td> <td id="LC2333" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_name</span> = dp-><span class="pl-smi">d_name</span>;</td> </tr> <tr> <td id="L2334" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2334"></td> <td id="LC2334" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L2335" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2335"></td> <td id="LC2335" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_altname</span> = dp-><span class="pl-smi">d_altname</span>;</td> </tr> <tr> <td id="L2336" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2336"></td> <td id="LC2336" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2337" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2337"></td> <td id="LC2337" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2338" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2338"></td> <td id="LC2338" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> !EMULATE_IFTODT</td> </tr> <tr> <td id="L2339" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2339"></td> <td id="LC2339" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_type</span> = dp-><span class="pl-smi">d_type</span>;</td> </tr> <tr> <td id="L2340" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2340"></td> <td id="LC2340" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L2341" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2341"></td> <td id="LC2341" class="blob-code blob-code-inner js-file-line"> newrdp-><span class="pl-smi">d_type</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2342" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2342"></td> <td id="LC2342" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2343" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2343"></td> <td id="LC2343" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> newrdp;</td> </tr> <tr> <td id="L2344" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2344"></td> <td id="LC2344" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2345" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2345"></td> <td id="LC2345" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2346" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2346"></td> <td id="LC2346" class="blob-code blob-code-inner js-file-line"><span class="pl-k">typedef</span> <span class="pl-k">union</span> {</td> </tr> <tr> <td id="L2347" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2347"></td> <td id="LC2347" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> {</td> </tr> <tr> <td id="L2348" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2348"></td> <td id="LC2348" class="blob-code blob-code-inner js-file-line"> DIR *dirp;</td> </tr> <tr> <td id="L2349" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2349"></td> <td id="LC2349" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_dirent_t</span> ent;</td> </tr> <tr> <td id="L2350" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2350"></td> <td id="LC2350" class="blob-code blob-code-inner js-file-line"> } nosort;</td> </tr> <tr> <td id="L2351" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2351"></td> <td id="LC2351" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> {</td> </tr> <tr> <td id="L2352" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2352"></td> <td id="LC2352" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> count, idx;</td> </tr> <tr> <td id="L2353" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2353"></td> <td id="LC2353" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_dirent_t</span> **entries;</td> </tr> <tr> <td id="L2354" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2354"></td> <td id="LC2354" class="blob-code blob-code-inner js-file-line"> } sort;</td> </tr> <tr> <td id="L2355" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2355"></td> <td id="LC2355" class="blob-code blob-code-inner js-file-line">} <span class="pl-c1">ruby_glob_entries_t</span>;</td> </tr> <tr> <td id="L2356" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2356"></td> <td id="LC2356" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2357" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2357"></td> <td id="LC2357" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2358" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2358"></td> <td id="LC2358" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_sort_cmp</span>(<span class="pl-k">const</span> <span class="pl-k">void</span> *a, <span class="pl-k">const</span> <span class="pl-k">void</span> *b, <span class="pl-k">void</span> *e)</td> </tr> <tr> <td id="L2359" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2359"></td> <td id="LC2359" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2360" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2360"></td> <td id="LC2360" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">rb_dirent_t</span> *ent1 = *(<span class="pl-k">void</span> **)a;</td> </tr> <tr> <td id="L2361" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2361"></td> <td id="LC2361" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">rb_dirent_t</span> *ent2 = *(<span class="pl-k">void</span> **)b;</td> </tr> <tr> <td id="L2362" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2362"></td> <td id="LC2362" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">strcmp</span>(ent1-><span class="pl-smi">d_name</span>, ent2-><span class="pl-smi">d_name</span>);</td> </tr> <tr> <td id="L2363" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2363"></td> <td id="LC2363" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2364" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2364"></td> <td id="LC2364" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2365" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2365"></td> <td id="LC2365" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L2366" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2366"></td> <td id="LC2366" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_dir_finish</span>(<span class="pl-c1">ruby_glob_entries_t</span> *ent, <span class="pl-k">int</span> flags)</td> </tr> <tr> <td id="L2367" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2367"></td> <td id="LC2367" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2368" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2368"></td> <td id="LC2368" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (flags & FNM_GLOB_NOSORT) {</td> </tr> <tr> <td id="L2369" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2369"></td> <td id="LC2369" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">closedir</span>(ent-><span class="pl-smi">nosort</span>.<span class="pl-smi">dirp</span>);</td> </tr> <tr> <td id="L2370" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2370"></td> <td id="LC2370" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">nosort</span>.<span class="pl-smi">dirp</span> = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2371" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2371"></td> <td id="LC2371" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2372" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2372"></td> <td id="LC2372" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-k">if</span> (ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>) {</td> </tr> <tr> <td id="L2373" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2373"></td> <td id="LC2373" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (<span class="pl-c1">size_t</span> i = <span class="pl-c1">0</span>, count = ent-><span class="pl-smi">sort</span>.<span class="pl-smi">count</span>; i < count;) {</td> </tr> <tr> <td id="L2374" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2374"></td> <td id="LC2374" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>[i++]);</td> </tr> <tr> <td id="L2375" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2375"></td> <td id="LC2375" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2376" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2376"></td> <td id="LC2376" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>);</td> </tr> <tr> <td id="L2377" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2377"></td> <td id="LC2377" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span> = <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2378" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2378"></td> <td id="LC2378" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">count</span> = ent-><span class="pl-smi">sort</span>.<span class="pl-smi">idx</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2379" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2379"></td> <td id="LC2379" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2380" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2380"></td> <td id="LC2380" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2381" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2381"></td> <td id="LC2381" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2382" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2382"></td> <td id="LC2382" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-c1">ruby_glob_entries_t</span> *</td> </tr> <tr> <td id="L2383" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2383"></td> <td id="LC2383" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_opendir</span>(<span class="pl-c1">ruby_glob_entries_t</span> *ent, DIR *dirp, <span class="pl-k">int</span> flags, rb_encoding *enc)</td> </tr> <tr> <td id="L2384" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2384"></td> <td id="LC2384" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2385" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2385"></td> <td id="LC2385" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">MEMZERO</span>(ent, <span class="pl-c1">ruby_glob_entries_t</span>, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L2386" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2386"></td> <td id="LC2386" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (flags & FNM_GLOB_NOSORT) {</td> </tr> <tr> <td id="L2387" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2387"></td> <td id="LC2387" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">nosort</span>.<span class="pl-smi">dirp</span> = dirp;</td> </tr> <tr> <td id="L2388" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2388"></td> <td id="LC2388" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ent;</td> </tr> <tr> <td id="L2389" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2389"></td> <td id="LC2389" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2390" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2390"></td> <td id="LC2390" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2391" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2391"></td> <td id="LC2391" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">void</span> *newp;</td> </tr> <tr> <td id="L2392" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2392"></td> <td id="LC2392" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dirent *dp;</td> </tr> <tr> <td id="L2393" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2393"></td> <td id="LC2393" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> count = <span class="pl-c1">0</span>, capacity = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2394" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2394"></td> <td id="LC2394" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">count</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2395" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2395"></td> <td id="LC2395" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">idx</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2396" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2396"></td> <td id="LC2396" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2397" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2397"></td> <td id="LC2397" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> _WIN32</td> </tr> <tr> <td id="L2398" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2398"></td> <td id="LC2398" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> ((capacity = dirp-><span class="pl-smi">nfiles</span>) > <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L2399" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2399"></td> <td id="LC2399" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!(newp = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-c1">rb_dirent_t</span>, capacity))) {</td> </tr> <tr> <td id="L2400" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2400"></td> <td id="LC2400" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">closedir</span>(dirp);</td> </tr> <tr> <td id="L2401" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2401"></td> <td id="LC2401" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2402" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2402"></td> <td id="LC2402" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2403" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2403"></td> <td id="LC2403" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span> = newp;</td> </tr> <tr> <td id="L2404" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2404"></td> <td id="LC2404" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2405" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2405"></td> <td id="LC2405" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2406" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2406"></td> <td id="LC2406" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> ((dp = <span class="pl-c1">READDIR</span>(dirp, enc)) != <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L2407" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2407"></td> <td id="LC2407" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_dirent_t</span> *rdp = <span class="pl-c1">dirent_copy</span>(dp, <span class="pl-c1">NULL</span>);</td> </tr> <tr> <td id="L2408" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2408"></td> <td id="LC2408" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!rdp) {</td> </tr> <tr> <td id="L2409" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2409"></td> <td id="LC2409" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> nomem;</td> </tr> <tr> <td id="L2410" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2410"></td> <td id="LC2410" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2411" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2411"></td> <td id="LC2411" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (count >= capacity) {</td> </tr> <tr> <td id="L2412" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2412"></td> <td id="LC2412" class="blob-code blob-code-inner js-file-line"> capacity += <span class="pl-c1">256</span>;</td> </tr> <tr> <td id="L2413" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2413"></td> <td id="LC2413" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!(newp = <span class="pl-c1">GLOB_REALLOC_N</span>(ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>, capacity)))</td> </tr> <tr> <td id="L2414" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2414"></td> <td id="LC2414" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> nomem;</td> </tr> <tr> <td id="L2415" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2415"></td> <td id="LC2415" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span> = newp;</td> </tr> <tr> <td id="L2416" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2416"></td> <td id="LC2416" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2417" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2417"></td> <td id="LC2417" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>[count++] = rdp;</td> </tr> <tr> <td id="L2418" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2418"></td> <td id="LC2418" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">count</span> = count;</td> </tr> <tr> <td id="L2419" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2419"></td> <td id="LC2419" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2420" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2420"></td> <td id="LC2420" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">closedir</span>(dirp);</td> </tr> <tr> <td id="L2421" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2421"></td> <td id="LC2421" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (count < capacity) {</td> </tr> <tr> <td id="L2422" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2422"></td> <td id="LC2422" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!(newp = <span class="pl-c1">GLOB_REALLOC_N</span>(ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>, count))) {</td> </tr> <tr> <td id="L2423" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2423"></td> <td id="LC2423" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">glob_dir_finish</span>(ent, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L2424" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2424"></td> <td id="LC2424" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2425" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2425"></td> <td id="LC2425" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2426" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2426"></td> <td id="LC2426" class="blob-code blob-code-inner js-file-line"> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span> = newp;</td> </tr> <tr> <td id="L2427" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2427"></td> <td id="LC2427" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2428" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2428"></td> <td id="LC2428" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">ruby_qsort</span>(ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>, ent-><span class="pl-smi">sort</span>.<span class="pl-smi">count</span>, <span class="pl-k">sizeof</span>(ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>[<span class="pl-c1">0</span>]),</td> </tr> <tr> <td id="L2429" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2429"></td> <td id="LC2429" class="blob-code blob-code-inner js-file-line"> glob_sort_cmp, <span class="pl-c1">NULL</span>);</td> </tr> <tr> <td id="L2430" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2430"></td> <td id="LC2430" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ent;</td> </tr> <tr> <td id="L2431" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2431"></td> <td id="LC2431" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2432" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2432"></td> <td id="LC2432" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2433" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2433"></td> <td id="LC2433" class="blob-code blob-code-inner js-file-line"> nomem:</td> </tr> <tr> <td id="L2434" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2434"></td> <td id="LC2434" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">glob_dir_finish</span>(ent, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L2435" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2435"></td> <td id="LC2435" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">closedir</span>(dirp);</td> </tr> <tr> <td id="L2436" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2436"></td> <td id="LC2436" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2437" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2437"></td> <td id="LC2437" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2438" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2438"></td> <td id="LC2438" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2439" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2439"></td> <td id="LC2439" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-c1">rb_dirent_t</span> *</td> </tr> <tr> <td id="L2440" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2440"></td> <td id="LC2440" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_getent</span>(<span class="pl-c1">ruby_glob_entries_t</span> *ent, <span class="pl-k">int</span> flags, rb_encoding *enc)</td> </tr> <tr> <td id="L2441" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2441"></td> <td id="LC2441" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2442" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2442"></td> <td id="LC2442" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (flags & FNM_GLOB_NOSORT) {</td> </tr> <tr> <td id="L2443" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2443"></td> <td id="LC2443" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">dirent_copy</span>(<span class="pl-c1">READDIR</span>(ent-><span class="pl-smi">nosort</span>.<span class="pl-smi">dirp</span>, enc), &ent-><span class="pl-smi">nosort</span>.<span class="pl-smi">ent</span>);</td> </tr> <tr> <td id="L2444" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2444"></td> <td id="LC2444" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2445" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2445"></td> <td id="LC2445" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-k">if</span> (ent-><span class="pl-smi">sort</span>.<span class="pl-smi">idx</span> < ent-><span class="pl-smi">sort</span>.<span class="pl-smi">count</span>) {</td> </tr> <tr> <td id="L2446" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2446"></td> <td id="LC2446" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ent-><span class="pl-smi">sort</span>.<span class="pl-smi">entries</span>[ent-><span class="pl-smi">sort</span>.<span class="pl-smi">idx</span>++];</td> </tr> <tr> <td id="L2447" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2447"></td> <td id="LC2447" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2448" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2448"></td> <td id="LC2448" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2449" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2449"></td> <td id="LC2449" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">NULL</span>;</td> </tr> <tr> <td id="L2450" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2450"></td> <td id="LC2450" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2451" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2451"></td> <td id="LC2451" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2452" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2452"></td> <td id="LC2452" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2453" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2453"></td> <td id="LC2453" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2454" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2454"></td> <td id="LC2454" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_helper</span>(</td> </tr> <tr> <td id="L2455" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2455"></td> <td id="LC2455" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd,</td> </tr> <tr> <td id="L2456" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2456"></td> <td id="LC2456" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path,</td> </tr> <tr> <td id="L2457" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2457"></td> <td id="LC2457" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> baselen,</td> </tr> <tr> <td id="L2458" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2458"></td> <td id="LC2458" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> namelen,</td> </tr> <tr> <td id="L2459" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2459"></td> <td id="LC2459" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> dirsep, <span class="pl-c"><span class="pl-c">/*</span> '/' should be placed before appending child entry's name to 'path'. <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2460" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2460"></td> <td id="LC2460" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_pathtype_t</span> pathtype, <span class="pl-c"><span class="pl-c">/*</span> type of 'path' <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2461" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2461"></td> <td id="LC2461" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern **beg,</td> </tr> <tr> <td id="L2462" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2462"></td> <td id="LC2462" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern **end,</td> </tr> <tr> <td id="L2463" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2463"></td> <td id="LC2463" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags,</td> </tr> <tr> <td id="L2464" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2464"></td> <td id="LC2464" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">ruby_glob_funcs_t</span> *funcs,</td> </tr> <tr> <td id="L2465" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2465"></td> <td id="LC2465" class="blob-code blob-code-inner js-file-line"> VALUE arg,</td> </tr> <tr> <td id="L2466" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2466"></td> <td id="LC2466" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc)</td> </tr> <tr> <td id="L2467" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2467"></td> <td id="LC2467" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2468" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2468"></td> <td id="LC2468" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> stat st;</td> </tr> <tr> <td id="L2469" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2469"></td> <td id="LC2469" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2470" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2470"></td> <td id="LC2470" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern **cur, **new_beg, **new_end;</td> </tr> <tr> <td id="L2471" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2471"></td> <td id="LC2471" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> plain = <span class="pl-c1">0</span>, brace = <span class="pl-c1">0</span>, magical = <span class="pl-c1">0</span>, recursive = <span class="pl-c1">0</span>, match_all = <span class="pl-c1">0</span>, match_dir = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2472" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2472"></td> <td id="LC2472" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> escape = !(flags & FNM_NOESCAPE);</td> </tr> <tr> <td id="L2473" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2473"></td> <td id="LC2473" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> pathlen = baselen + namelen;</td> </tr> <tr> <td id="L2474" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2474"></td> <td id="LC2474" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2475" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2475"></td> <td id="LC2475" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_check_stack_overflow</span>();</td> </tr> <tr> <td id="L2476" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2476"></td> <td id="LC2476" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2477" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2477"></td> <td id="LC2477" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (cur = beg; cur < end; ++cur) {</td> </tr> <tr> <td id="L2478" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2478"></td> <td id="LC2478" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *p = *cur;</td> </tr> <tr> <td id="L2479" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2479"></td> <td id="LC2479" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (p-><span class="pl-smi">type</span> == RECURSIVE) {</td> </tr> <tr> <td id="L2480" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2480"></td> <td id="LC2480" class="blob-code blob-code-inner js-file-line"> recursive = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2481" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2481"></td> <td id="LC2481" class="blob-code blob-code-inner js-file-line"> p = p-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L2482" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2482"></td> <td id="LC2482" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2483" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2483"></td> <td id="LC2483" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (p-><span class="pl-smi">type</span>) {</td> </tr> <tr> <td id="L2484" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2484"></td> <td id="LC2484" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> PLAIN:</td> </tr> <tr> <td id="L2485" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2485"></td> <td id="LC2485" class="blob-code blob-code-inner js-file-line"> plain = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2486" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2486"></td> <td id="LC2486" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2487" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2487"></td> <td id="LC2487" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ALPHA:</td> </tr> <tr> <td id="L2488" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2488"></td> <td id="LC2488" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME</td> </tr> <tr> <td id="L2489" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2489"></td> <td id="LC2489" class="blob-code blob-code-inner js-file-line"> plain = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2490" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2490"></td> <td id="LC2490" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L2491" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2491"></td> <td id="LC2491" class="blob-code blob-code-inner js-file-line"> magical = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2492" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2492"></td> <td id="LC2492" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2493" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2493"></td> <td id="LC2493" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2494" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2494"></td> <td id="LC2494" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> BRACE:</td> </tr> <tr> <td id="L2495" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2495"></td> <td id="LC2495" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!recursive || <span class="pl-c1">strchr</span>(p-><span class="pl-smi">str</span>, <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>)) {</td> </tr> <tr> <td id="L2496" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2496"></td> <td id="LC2496" class="blob-code blob-code-inner js-file-line"> brace = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2497" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2497"></td> <td id="LC2497" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2498" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2498"></td> <td id="LC2498" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2499" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2499"></td> <td id="LC2499" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> MAGICAL:</td> </tr> <tr> <td id="L2500" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2500"></td> <td id="LC2500" class="blob-code blob-code-inner js-file-line"> magical = <span class="pl-c1">2</span>;</td> </tr> <tr> <td id="L2501" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2501"></td> <td id="LC2501" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2502" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2502"></td> <td id="LC2502" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> MATCH_ALL:</td> </tr> <tr> <td id="L2503" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2503"></td> <td id="LC2503" class="blob-code blob-code-inner js-file-line"> match_all = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2504" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2504"></td> <td id="LC2504" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2505" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2505"></td> <td id="LC2505" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> MATCH_DIR:</td> </tr> <tr> <td id="L2506" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2506"></td> <td id="LC2506" class="blob-code blob-code-inner js-file-line"> match_dir = <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2507" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2507"></td> <td id="LC2507" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2508" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2508"></td> <td id="LC2508" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> RECURSIVE:</td> </tr> <tr> <td id="L2509" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2509"></td> <td id="LC2509" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_bug</span>(<span class="pl-s"><span class="pl-pds">"</span>continuous RECURSIVEs<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L2510" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2510"></td> <td id="LC2510" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2511" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2511"></td> <td id="LC2511" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2512" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2512"></td> <td id="LC2512" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2513" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2513"></td> <td id="LC2513" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (brace) {</td> </tr> <tr> <td id="L2514" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2514"></td> <td id="LC2514" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> push_glob_args args;</td> </tr> <tr> <td id="L2515" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2515"></td> <td id="LC2515" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span>* brace_path = <span class="pl-c1">join_path_from_pattern</span>(beg);</td> </tr> <tr> <td id="L2516" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2516"></td> <td id="LC2516" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!brace_path) <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2517" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2517"></td> <td id="LC2517" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">fd</span> = fd;</td> </tr> <tr> <td id="L2518" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2518"></td> <td id="LC2518" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">path</span> = path;</td> </tr> <tr> <td id="L2519" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2519"></td> <td id="LC2519" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">baselen</span> = baselen;</td> </tr> <tr> <td id="L2520" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2520"></td> <td id="LC2520" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">namelen</span> = namelen;</td> </tr> <tr> <td id="L2521" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2521"></td> <td id="LC2521" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">dirsep</span> = dirsep;</td> </tr> <tr> <td id="L2522" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2522"></td> <td id="LC2522" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">pathtype</span> = pathtype;</td> </tr> <tr> <td id="L2523" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2523"></td> <td id="LC2523" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">flags</span> = flags;</td> </tr> <tr> <td id="L2524" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2524"></td> <td id="LC2524" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">funcs</span> = funcs;</td> </tr> <tr> <td id="L2525" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2525"></td> <td id="LC2525" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">arg</span> = arg;</td> </tr> <tr> <td id="L2526" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2526"></td> <td id="LC2526" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">ruby_brace_expand</span>(brace_path, flags, push_caller, (VALUE)&args, enc, Qfalse);</td> </tr> <tr> <td id="L2527" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2527"></td> <td id="LC2527" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(brace_path);</td> </tr> <tr> <td id="L2528" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2528"></td> <td id="LC2528" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2529" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2529"></td> <td id="LC2529" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2530" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2530"></td> <td id="LC2530" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2531" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2531"></td> <td id="LC2531" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*path) {</td> </tr> <tr> <td id="L2532" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2532"></td> <td id="LC2532" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (match_all && pathtype == path_unknown) {</td> </tr> <tr> <td id="L2533" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2533"></td> <td id="LC2533" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">do_lstat</span>(fd, baselen, path, &st, flags, enc) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L2534" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2534"></td> <td id="LC2534" class="blob-code blob-code-inner js-file-line"> pathtype = <span class="pl-c1">IFTODT</span>(st.<span class="pl-smi">st_mode</span>);</td> </tr> <tr> <td id="L2535" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2535"></td> <td id="LC2535" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2536" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2536"></td> <td id="LC2536" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2537" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2537"></td> <td id="LC2537" class="blob-code blob-code-inner js-file-line"> pathtype = path_noent;</td> </tr> <tr> <td id="L2538" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2538"></td> <td id="LC2538" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2539" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2539"></td> <td id="LC2539" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2540" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2540"></td> <td id="LC2540" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (match_dir && (pathtype == path_unknown || pathtype == path_symlink)) {</td> </tr> <tr> <td id="L2541" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2541"></td> <td id="LC2541" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">do_stat</span>(fd, baselen, path, &st, flags, enc) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L2542" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2542"></td> <td id="LC2542" class="blob-code blob-code-inner js-file-line"> pathtype = <span class="pl-c1">IFTODT</span>(st.<span class="pl-smi">st_mode</span>);</td> </tr> <tr> <td id="L2543" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2543"></td> <td id="LC2543" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2544" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2544"></td> <td id="LC2544" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2545" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2545"></td> <td id="LC2545" class="blob-code blob-code-inner js-file-line"> pathtype = path_noent;</td> </tr> <tr> <td id="L2546" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2546"></td> <td id="LC2546" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2547" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2547"></td> <td id="LC2547" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2548" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2548"></td> <td id="LC2548" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (match_all && pathtype > path_noent) {</td> </tr> <tr> <td id="L2549" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2549"></td> <td id="LC2549" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *subpath = path + baselen + (baselen && path[baselen] == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>);</td> </tr> <tr> <td id="L2550" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2550"></td> <td id="LC2550" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">glob_call_func</span>(funcs-><span class="pl-smi">match</span>, subpath, arg, enc);</td> </tr> <tr> <td id="L2551" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2551"></td> <td id="LC2551" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2552" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2552"></td> <td id="LC2552" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2553" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2553"></td> <td id="LC2553" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (match_dir && pathtype == path_directory) {</td> </tr> <tr> <td id="L2554" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2554"></td> <td id="LC2554" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> seplen = (baselen && path[baselen] == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>);</td> </tr> <tr> <td id="L2555" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2555"></td> <td id="LC2555" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *subpath = path + baselen + seplen;</td> </tr> <tr> <td id="L2556" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2556"></td> <td id="LC2556" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *tmp = <span class="pl-c1">join_path</span>(subpath, namelen - seplen, dirsep, <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L2557" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2557"></td> <td id="LC2557" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!tmp) <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2558" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2558"></td> <td id="LC2558" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">glob_call_func</span>(funcs-><span class="pl-smi">match</span>, tmp, arg, enc);</td> </tr> <tr> <td id="L2559" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2559"></td> <td id="LC2559" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(tmp);</td> </tr> <tr> <td id="L2560" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2560"></td> <td id="LC2560" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2561" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2561"></td> <td id="LC2561" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2562" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2562"></td> <td id="LC2562" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2563" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2563"></td> <td id="LC2563" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2564" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2564"></td> <td id="LC2564" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (pathtype == path_noent) <span class="pl-k">return</span> <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2565" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2565"></td> <td id="LC2565" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2566" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2566"></td> <td id="LC2566" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (magical || recursive) {</td> </tr> <tr> <td id="L2567" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2567"></td> <td id="LC2567" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_dirent_t</span> *dp;</td> </tr> <tr> <td id="L2568" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2568"></td> <td id="LC2568" class="blob-code blob-code-inner js-file-line"> DIR *dirp;</td> </tr> <tr> <td id="L2569" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2569"></td> <td id="LC2569" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH</td> </tr> <tr> <td id="L2570" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2570"></td> <td id="LC2570" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *plainname = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2571" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2571"></td> <td id="LC2571" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2572" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2572"></td> <td id="LC2572" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(<span class="pl-k">int</span> norm_p);</td> </tr> <tr> <td id="L2573" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2573"></td> <td id="LC2573" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH</td> </tr> <tr> <td id="L2574" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2574"></td> <td id="LC2574" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (cur + <span class="pl-c1">1</span> == end && (*cur)-><span class="pl-smi">type</span> <= ALPHA) {</td> </tr> <tr> <td id="L2575" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2575"></td> <td id="LC2575" class="blob-code blob-code-inner js-file-line"> plainname = <span class="pl-c1">join_path</span>(path, pathlen, dirsep, (*cur)-><span class="pl-smi">str</span>, <span class="pl-c1">strlen</span>((*cur)-><span class="pl-smi">str</span>));</td> </tr> <tr> <td id="L2576" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2576"></td> <td id="LC2576" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!plainname) <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2577" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2577"></td> <td id="LC2577" class="blob-code blob-code-inner js-file-line"> dirp = <span class="pl-c1">do_opendir</span>(fd, basename, plainname, flags, enc, funcs-><span class="pl-smi">error</span>, arg, &status);</td> </tr> <tr> <td id="L2578" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2578"></td> <td id="LC2578" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(plainname);</td> </tr> <tr> <td id="L2579" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2579"></td> <td id="LC2579" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2580" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2580"></td> <td id="LC2580" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L2581" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2581"></td> <td id="LC2581" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">else</span></td> </tr> <tr> <td id="L2582" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2582"></td> <td id="LC2582" class="blob-code blob-code-inner js-file-line"> ;</td> </tr> <tr> <td id="L2583" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2583"></td> <td id="LC2583" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2584" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2584"></td> <td id="LC2584" class="blob-code blob-code-inner js-file-line"> dirp = <span class="pl-c1">do_opendir</span>(fd, baselen, path, flags, enc, funcs-><span class="pl-smi">error</span>, arg, &status);</td> </tr> <tr> <td id="L2585" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2585"></td> <td id="LC2585" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dirp == <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L2586" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2586"></td> <td id="LC2586" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> FNM_SYSCASE || NORMALIZE_UTF8PATH</td> </tr> <tr> <td id="L2587" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2587"></td> <td id="LC2587" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> ((magical < <span class="pl-c1">2</span>) && !recursive && (errno == EACCES)) {</td> </tr> <tr> <td id="L2588" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2588"></td> <td id="LC2588" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> no read permission, fallback <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2589" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2589"></td> <td id="LC2589" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> literally;</td> </tr> <tr> <td id="L2590" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2590"></td> <td id="LC2590" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2591" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2591"></td> <td id="LC2591" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2592" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2592"></td> <td id="LC2592" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2593" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2593"></td> <td id="LC2593" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2594" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2594"></td> <td id="LC2594" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(norm_p = <span class="pl-c1">need_normalization</span>(dirp, *path ? path : <span class="pl-s"><span class="pl-pds">"</span>.<span class="pl-pds">"</span></span>));</td> </tr> <tr> <td id="L2595" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2595"></td> <td id="LC2595" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2596" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2596"></td> <td id="LC2596" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> NORMALIZE_UTF8PATH</td> </tr> <tr> <td id="L2597" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2597"></td> <td id="LC2597" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!(norm_p || magical || recursive)) {</td> </tr> <tr> <td id="L2598" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2598"></td> <td id="LC2598" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">closedir</span>(dirp);</td> </tr> <tr> <td id="L2599" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2599"></td> <td id="LC2599" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">goto</span> literally;</td> </tr> <tr> <td id="L2600" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2600"></td> <td id="LC2600" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2601" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2601"></td> <td id="LC2601" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2602" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2602"></td> <td id="LC2602" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">ifdef</span> HAVE_GETATTRLIST</td> </tr> <tr> <td id="L2603" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2603"></td> <td id="LC2603" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">is_case_sensitive</span>(dirp, path) == <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L2604" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2604"></td> <td id="LC2604" class="blob-code blob-code-inner js-file-line"> flags |= FNM_CASEFOLD;</td> </tr> <tr> <td id="L2605" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2605"></td> <td id="LC2605" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2606" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2606"></td> <td id="LC2606" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">ruby_glob_entries_t</span> globent;</td> </tr> <tr> <td id="L2607" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2607"></td> <td id="LC2607" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">glob_opendir</span>(&globent, dirp, flags, enc)) {</td> </tr> <tr> <td id="L2608" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2608"></td> <td id="LC2608" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2609" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2609"></td> <td id="LC2609" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (funcs-><span class="pl-smi">error</span>) {</td> </tr> <tr> <td id="L2610" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2610"></td> <td id="LC2610" class="blob-code blob-code-inner js-file-line"> status = (*funcs-><span class="pl-smi">error</span>)(path, arg, enc, ENOMEM);</td> </tr> <tr> <td id="L2611" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2611"></td> <td id="LC2611" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2612" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2612"></td> <td id="LC2612" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L2613" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2613"></td> <td id="LC2613" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">sys_warning</span>(path, enc);</td> </tr> <tr> <td id="L2614" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2614"></td> <td id="LC2614" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2615" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2615"></td> <td id="LC2615" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2616" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2616"></td> <td id="LC2616" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2617" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2617"></td> <td id="LC2617" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2618" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2618"></td> <td id="LC2618" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> skipdot = (flags & FNM_GLOB_SKIPDOT);</td> </tr> <tr> <td id="L2619" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2619"></td> <td id="LC2619" class="blob-code blob-code-inner js-file-line"> flags |= FNM_GLOB_SKIPDOT;</td> </tr> <tr> <td id="L2620" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2620"></td> <td id="LC2620" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2621" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2621"></td> <td id="LC2621" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> ((dp = <span class="pl-c1">glob_getent</span>(&globent, flags, enc)) != <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L2622" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2622"></td> <td id="LC2622" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf;</td> </tr> <tr> <td id="L2623" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2623"></td> <td id="LC2623" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_pathtype_t</span> new_pathtype = path_unknown;</td> </tr> <tr> <td id="L2624" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2624"></td> <td id="LC2624" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *name;</td> </tr> <tr> <td id="L2625" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2625"></td> <td id="LC2625" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> namlen;</td> </tr> <tr> <td id="L2626" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2626"></td> <td id="LC2626" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> dotfile = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2627" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2627"></td> <td id="LC2627" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(VALUE utf8str = Qnil);</td> </tr> <tr> <td id="L2628" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2628"></td> <td id="LC2628" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2629" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2629"></td> <td id="LC2629" class="blob-code blob-code-inner js-file-line"> name = dp-><span class="pl-smi">d_name</span>;</td> </tr> <tr> <td id="L2630" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2630"></td> <td id="LC2630" class="blob-code blob-code-inner js-file-line"> namlen = dp-><span class="pl-smi">d_namlen</span>;</td> </tr> <tr> <td id="L2631" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2631"></td> <td id="LC2631" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (name[<span class="pl-c1">0</span>] == <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L2632" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2632"></td> <td id="LC2632" class="blob-code blob-code-inner js-file-line"> ++dotfile;</td> </tr> <tr> <td id="L2633" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2633"></td> <td id="LC2633" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (namlen == <span class="pl-c1">1</span>) {</td> </tr> <tr> <td id="L2634" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2634"></td> <td id="LC2634" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> unless DOTMATCH, skip current directories not to recurse infinitely <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2635" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2635"></td> <td id="LC2635" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (recursive && !(flags & FNM_DOTMATCH)) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L2636" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2636"></td> <td id="LC2636" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (skipdot) <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L2637" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2637"></td> <td id="LC2637" class="blob-code blob-code-inner js-file-line"> ++dotfile;</td> </tr> <tr> <td id="L2638" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2638"></td> <td id="LC2638" class="blob-code blob-code-inner js-file-line"> new_pathtype = path_directory; <span class="pl-c"><span class="pl-c">/*</span> force to skip stat/lstat <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2639" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2639"></td> <td id="LC2639" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2640" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2640"></td> <td id="LC2640" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-k">if</span> (namlen == <span class="pl-c1">2</span> && name[<span class="pl-c1">1</span>] == <span class="pl-s"><span class="pl-pds">'</span>.<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L2641" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2641"></td> <td id="LC2641" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> always skip parent directories not to recurse infinitely <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2642" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2642"></td> <td id="LC2642" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">continue</span>;</td> </tr> <tr> <td id="L2643" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2643"></td> <td id="LC2643" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2644" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2644"></td> <td id="LC2644" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2645" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2645"></td> <td id="LC2645" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2646" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2646"></td> <td id="LC2646" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> NORMALIZE_UTF8PATH</td> </tr> <tr> <td id="L2647" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2647"></td> <td id="LC2647" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (norm_p && <span class="pl-c1">has_nonascii</span>(name, namlen)) {</td> </tr> <tr> <td id="L2648" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2648"></td> <td id="LC2648" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">NIL_P</span>(utf8str = <span class="pl-c1">rb_str_normalize_ospath</span>(name, namlen))) {</td> </tr> <tr> <td id="L2649" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2649"></td> <td id="LC2649" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RSTRING_GETMEM</span>(utf8str, name, namlen);</td> </tr> <tr> <td id="L2650" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2650"></td> <td id="LC2650" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2651" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2651"></td> <td id="LC2651" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2652" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2652"></td> <td id="LC2652" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2653" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2653"></td> <td id="LC2653" class="blob-code blob-code-inner js-file-line"> buf = <span class="pl-c1">join_path</span>(path, pathlen, dirsep, name, namlen);</td> </tr> <tr> <td id="L2654" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2654"></td> <td id="LC2654" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(<span class="pl-k">if</span> (!<span class="pl-c1">NIL_P</span>(utf8str)) <span class="pl-c1">rb_str_resize</span>(utf8str, <span class="pl-c1">0</span>));</td> </tr> <tr> <td id="L2655" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2655"></td> <td id="LC2655" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!buf) {</td> </tr> <tr> <td id="L2656" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2656"></td> <td id="LC2656" class="blob-code blob-code-inner js-file-line"> status = -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2657" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2657"></td> <td id="LC2657" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2658" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2658"></td> <td id="LC2658" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2659" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2659"></td> <td id="LC2659" class="blob-code blob-code-inner js-file-line"> name = buf + pathlen + (dirsep != <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L2660" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2660"></td> <td id="LC2660" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> !EMULATE_IFTODT</td> </tr> <tr> <td id="L2661" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2661"></td> <td id="LC2661" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dp-><span class="pl-smi">d_type</span> != DT_UNKNOWN) {</td> </tr> <tr> <td id="L2662" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2662"></td> <td id="LC2662" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Got it. We need no more lstat. <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2663" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2663"></td> <td id="LC2663" class="blob-code blob-code-inner js-file-line"> new_pathtype = dp-><span class="pl-smi">d_type</span>;</td> </tr> <tr> <td id="L2664" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2664"></td> <td id="LC2664" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2665" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2665"></td> <td id="LC2665" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2666" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2666"></td> <td id="LC2666" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (recursive && dotfile < ((flags & FNM_DOTMATCH) ? <span class="pl-c1">2</span> : <span class="pl-c1">1</span>) &&</td> </tr> <tr> <td id="L2667" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2667"></td> <td id="LC2667" class="blob-code blob-code-inner js-file-line"> new_pathtype == path_unknown) {</td> </tr> <tr> <td id="L2668" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2668"></td> <td id="LC2668" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> RECURSIVE never match dot files unless FNM_DOTMATCH is set <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2669" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2669"></td> <td id="LC2669" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">do_lstat</span>(fd, baselen, buf, &st, flags, enc) == <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L2670" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2670"></td> <td id="LC2670" class="blob-code blob-code-inner js-file-line"> new_pathtype = <span class="pl-c1">IFTODT</span>(st.<span class="pl-smi">st_mode</span>);</td> </tr> <tr> <td id="L2671" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2671"></td> <td id="LC2671" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L2672" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2672"></td> <td id="LC2672" class="blob-code blob-code-inner js-file-line"> new_pathtype = path_noent;</td> </tr> <tr> <td id="L2673" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2673"></td> <td id="LC2673" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2674" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2674"></td> <td id="LC2674" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2675" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2675"></td> <td id="LC2675" class="blob-code blob-code-inner js-file-line"> new_beg = new_end = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">struct</span> glob_pattern *, (end - beg) * <span class="pl-c1">2</span>);</td> </tr> <tr> <td id="L2676" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2676"></td> <td id="LC2676" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!new_beg) {</td> </tr> <tr> <td id="L2677" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2677"></td> <td id="LC2677" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(buf);</td> </tr> <tr> <td id="L2678" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2678"></td> <td id="LC2678" class="blob-code blob-code-inner js-file-line"> status = -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2679" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2679"></td> <td id="LC2679" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2680" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2680"></td> <td id="LC2680" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2681" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2681"></td> <td id="LC2681" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2682" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2682"></td> <td id="LC2682" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (cur = beg; cur < end; ++cur) {</td> </tr> <tr> <td id="L2683" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2683"></td> <td id="LC2683" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *p = *cur;</td> </tr> <tr> <td id="L2684" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2684"></td> <td id="LC2684" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dirent_brace_args args;</td> </tr> <tr> <td id="L2685" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2685"></td> <td id="LC2685" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (p-><span class="pl-smi">type</span> == RECURSIVE) {</td> </tr> <tr> <td id="L2686" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2686"></td> <td id="LC2686" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (new_pathtype == path_directory || <span class="pl-c"><span class="pl-c">/*</span> not symlink but real directory <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2687" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2687"></td> <td id="LC2687" class="blob-code blob-code-inner js-file-line"> new_pathtype == path_exist) {</td> </tr> <tr> <td id="L2688" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2688"></td> <td id="LC2688" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dotfile < ((flags & FNM_DOTMATCH) ? <span class="pl-c1">2</span> : <span class="pl-c1">1</span>))</td> </tr> <tr> <td id="L2689" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2689"></td> <td id="LC2689" class="blob-code blob-code-inner js-file-line"> *new_end++ = p; <span class="pl-c"><span class="pl-c">/*</span> append recursive pattern <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2690" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2690"></td> <td id="LC2690" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2691" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2691"></td> <td id="LC2691" class="blob-code blob-code-inner js-file-line"> p = p-><span class="pl-smi">next</span>; <span class="pl-c"><span class="pl-c">/*</span> 0 times recursion <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L2692" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2692"></td> <td id="LC2692" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2693" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2693"></td> <td id="LC2693" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (p-><span class="pl-smi">type</span>) {</td> </tr> <tr> <td id="L2694" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2694"></td> <td id="LC2694" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> BRACE:</td> </tr> <tr> <td id="L2695" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2695"></td> <td id="LC2695" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">name</span> = name;</td> </tr> <tr> <td id="L2696" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2696"></td> <td id="LC2696" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">dp</span> = dp;</td> </tr> <tr> <td id="L2697" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2697"></td> <td id="LC2697" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">flags</span> = flags;</td> </tr> <tr> <td id="L2698" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2698"></td> <td id="LC2698" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ruby_brace_expand</span>(p-><span class="pl-smi">str</span>, flags, dirent_match_brace,</td> </tr> <tr> <td id="L2699" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2699"></td> <td id="LC2699" class="blob-code blob-code-inner js-file-line"> (VALUE)&args, enc, Qfalse) > <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L2700" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2700"></td> <td id="LC2700" class="blob-code blob-code-inner js-file-line"> *new_end++ = p-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L2701" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2701"></td> <td id="LC2701" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2702" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2702"></td> <td id="LC2702" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> ALPHA:</td> </tr> <tr> <td id="L2703" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2703"></td> <td id="LC2703" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH</td> </tr> <tr> <td id="L2704" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2704"></td> <td id="LC2704" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (plainname) {</td> </tr> <tr> <td id="L2705" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2705"></td> <td id="LC2705" class="blob-code blob-code-inner js-file-line"> *new_end++ = p-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L2706" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2706"></td> <td id="LC2706" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2707" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2707"></td> <td id="LC2707" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2708" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2708"></td> <td id="LC2708" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2709" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2709"></td> <td id="LC2709" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> PLAIN:</td> </tr> <tr> <td id="L2710" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2710"></td> <td id="LC2710" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> MAGICAL:</td> </tr> <tr> <td id="L2711" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2711"></td> <td id="LC2711" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">dirent_match</span>(p-><span class="pl-smi">str</span>, enc, name, dp, flags))</td> </tr> <tr> <td id="L2712" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2712"></td> <td id="LC2712" class="blob-code blob-code-inner js-file-line"> *new_end++ = p-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L2713" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2713"></td> <td id="LC2713" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L2714" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2714"></td> <td id="LC2714" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2715" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2715"></td> <td id="LC2715" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2716" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2716"></td> <td id="LC2716" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2717" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2717"></td> <td id="LC2717" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2718" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2718"></td> <td id="LC2718" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">glob_helper</span>(fd, buf, baselen, name - buf - baselen + namlen, <span class="pl-c1">1</span>,</td> </tr> <tr> <td id="L2719" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2719"></td> <td id="LC2719" class="blob-code blob-code-inner js-file-line"> new_pathtype, new_beg, new_end,</td> </tr> <tr> <td id="L2720" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2720"></td> <td id="LC2720" class="blob-code blob-code-inner js-file-line"> flags, funcs, arg, enc);</td> </tr> <tr> <td id="L2721" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2721"></td> <td id="LC2721" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(buf);</td> </tr> <tr> <td id="L2722" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2722"></td> <td id="LC2722" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(new_beg);</td> </tr> <tr> <td id="L2723" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2723"></td> <td id="LC2723" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2724" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2724"></td> <td id="LC2724" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2725" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2725"></td> <td id="LC2725" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2726" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2726"></td> <td id="LC2726" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">glob_dir_finish</span>(&globent, flags);</td> </tr> <tr> <td id="L2727" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2727"></td> <td id="LC2727" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2728" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2728"></td> <td id="LC2728" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-k">if</span> (plain) {</td> </tr> <tr> <td id="L2729" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2729"></td> <td id="LC2729" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern **copy_beg, **copy_end, **cur2;</td> </tr> <tr> <td id="L2730" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2730"></td> <td id="LC2730" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2731" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2731"></td> <td id="LC2731" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">if</span> FNM_SYSCASE || NORMALIZE_UTF8PATH</td> </tr> <tr> <td id="L2732" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2732"></td> <td id="LC2732" class="blob-code blob-code-inner js-file-line"> literally:</td> </tr> <tr> <td id="L2733" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2733"></td> <td id="LC2733" class="blob-code blob-code-inner js-file-line"># <span class="pl-k">endif</span></td> </tr> <tr> <td id="L2734" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2734"></td> <td id="LC2734" class="blob-code blob-code-inner js-file-line"> copy_beg = copy_end = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">struct</span> glob_pattern *, end - beg);</td> </tr> <tr> <td id="L2735" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2735"></td> <td id="LC2735" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!copy_beg) <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2736" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2736"></td> <td id="LC2736" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (cur = beg; cur < end; ++cur)</td> </tr> <tr> <td id="L2737" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2737"></td> <td id="LC2737" class="blob-code blob-code-inner js-file-line"> *copy_end++ = (*cur)-><span class="pl-smi">type</span> <= ALPHA ? *cur : <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2738" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2738"></td> <td id="LC2738" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2739" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2739"></td> <td id="LC2739" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (cur = copy_beg; cur < copy_end; ++cur) {</td> </tr> <tr> <td id="L2740" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2740"></td> <td id="LC2740" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*cur) {</td> </tr> <tr> <td id="L2741" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2741"></td> <td id="LC2741" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_pathtype_t</span> new_pathtype = path_unknown;</td> </tr> <tr> <td id="L2742" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2742"></td> <td id="LC2742" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf;</td> </tr> <tr> <td id="L2743" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2743"></td> <td id="LC2743" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *name;</td> </tr> <tr> <td id="L2744" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2744"></td> <td id="LC2744" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> len = <span class="pl-c1">strlen</span>((*cur)-><span class="pl-smi">str</span>) + <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2745" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2745"></td> <td id="LC2745" class="blob-code blob-code-inner js-file-line"> name = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">char</span>, len);</td> </tr> <tr> <td id="L2746" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2746"></td> <td id="LC2746" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!name) {</td> </tr> <tr> <td id="L2747" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2747"></td> <td id="LC2747" class="blob-code blob-code-inner js-file-line"> status = -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2748" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2748"></td> <td id="LC2748" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2749" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2749"></td> <td id="LC2749" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2750" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2750"></td> <td id="LC2750" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(name, (*cur)-><span class="pl-smi">str</span>, len);</td> </tr> <tr> <td id="L2751" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2751"></td> <td id="LC2751" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (escape)</td> </tr> <tr> <td id="L2752" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2752"></td> <td id="LC2752" class="blob-code blob-code-inner js-file-line"> len = <span class="pl-c1">remove_backslashes</span>(name, name+len-<span class="pl-c1">1</span>, enc) - name;</td> </tr> <tr> <td id="L2753" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2753"></td> <td id="LC2753" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2754" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2754"></td> <td id="LC2754" class="blob-code blob-code-inner js-file-line"> new_beg = new_end = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">struct</span> glob_pattern *, end - beg);</td> </tr> <tr> <td id="L2755" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2755"></td> <td id="LC2755" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!new_beg) {</td> </tr> <tr> <td id="L2756" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2756"></td> <td id="LC2756" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(name);</td> </tr> <tr> <td id="L2757" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2757"></td> <td id="LC2757" class="blob-code blob-code-inner js-file-line"> status = -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2758" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2758"></td> <td id="LC2758" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2759" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2759"></td> <td id="LC2759" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2760" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2760"></td> <td id="LC2760" class="blob-code blob-code-inner js-file-line"> *new_end++ = (*cur)-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L2761" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2761"></td> <td id="LC2761" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (cur2 = cur + <span class="pl-c1">1</span>; cur2 < copy_end; ++cur2) {</td> </tr> <tr> <td id="L2762" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2762"></td> <td id="LC2762" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*cur2 && <span class="pl-c1">fnmatch</span>((*cur2)-><span class="pl-smi">str</span>, enc, name, flags) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L2763" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2763"></td> <td id="LC2763" class="blob-code blob-code-inner js-file-line"> *new_end++ = (*cur2)-><span class="pl-smi">next</span>;</td> </tr> <tr> <td id="L2764" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2764"></td> <td id="LC2764" class="blob-code blob-code-inner js-file-line"> *cur2 = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2765" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2765"></td> <td id="LC2765" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2766" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2766"></td> <td id="LC2766" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2767" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2767"></td> <td id="LC2767" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2768" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2768"></td> <td id="LC2768" class="blob-code blob-code-inner js-file-line"> buf = <span class="pl-c1">join_path</span>(path, pathlen, dirsep, name, len);</td> </tr> <tr> <td id="L2769" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2769"></td> <td id="LC2769" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(name);</td> </tr> <tr> <td id="L2770" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2770"></td> <td id="LC2770" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!buf) {</td> </tr> <tr> <td id="L2771" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2771"></td> <td id="LC2771" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(new_beg);</td> </tr> <tr> <td id="L2772" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2772"></td> <td id="LC2772" class="blob-code blob-code-inner js-file-line"> status = -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2773" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2773"></td> <td id="LC2773" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2774" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2774"></td> <td id="LC2774" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2775" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2775"></td> <td id="LC2775" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME</td> </tr> <tr> <td id="L2776" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2776"></td> <td id="LC2776" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> ((*cur)-><span class="pl-smi">type</span> == ALPHA) {</td> </tr> <tr> <td id="L2777" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2777"></td> <td id="LC2777" class="blob-code blob-code-inner js-file-line"> buf = <span class="pl-c1">replace_real_basename</span>(buf, pathlen + (dirsep != <span class="pl-c1">0</span>), enc,</td> </tr> <tr> <td id="L2778" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2778"></td> <td id="LC2778" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">IF_NORMALIZE_UTF8PATH</span>(<span class="pl-c1">1</span>)+<span class="pl-c1">0</span>,</td> </tr> <tr> <td id="L2779" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2779"></td> <td id="LC2779" class="blob-code blob-code-inner js-file-line"> flags, &new_pathtype);</td> </tr> <tr> <td id="L2780" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2780"></td> <td id="LC2780" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!buf) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2781" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2781"></td> <td id="LC2781" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2782" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2782"></td> <td id="LC2782" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2783" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2783"></td> <td id="LC2783" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">glob_helper</span>(fd, buf, baselen,</td> </tr> <tr> <td id="L2784" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2784"></td> <td id="LC2784" class="blob-code blob-code-inner js-file-line"> namelen + <span class="pl-c1">strlen</span>(buf + pathlen), <span class="pl-c1">1</span>,</td> </tr> <tr> <td id="L2785" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2785"></td> <td id="LC2785" class="blob-code blob-code-inner js-file-line"> new_pathtype, new_beg, new_end,</td> </tr> <tr> <td id="L2786" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2786"></td> <td id="LC2786" class="blob-code blob-code-inner js-file-line"> flags, funcs, arg, enc);</td> </tr> <tr> <td id="L2787" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2787"></td> <td id="LC2787" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(buf);</td> </tr> <tr> <td id="L2788" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2788"></td> <td id="LC2788" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(new_beg);</td> </tr> <tr> <td id="L2789" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2789"></td> <td id="LC2789" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2790" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2790"></td> <td id="LC2790" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2791" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2791"></td> <td id="LC2791" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2792" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2792"></td> <td id="LC2792" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2793" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2793"></td> <td id="LC2793" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(copy_beg);</td> </tr> <tr> <td id="L2794" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2794"></td> <td id="LC2794" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2795" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2795"></td> <td id="LC2795" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2796" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2796"></td> <td id="LC2796" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2797" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2797"></td> <td id="LC2797" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2798" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2798"></td> <td id="LC2798" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2799" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2799"></td> <td id="LC2799" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2800" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2800"></td> <td id="LC2800" class="blob-code blob-code-inner js-file-line"><span class="pl-en">push_caller</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, VALUE val, <span class="pl-k">void</span> *enc)</td> </tr> <tr> <td id="L2801" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2801"></td> <td id="LC2801" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2802" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2802"></td> <td id="LC2802" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> push_glob_args *arg = (<span class="pl-k">struct</span> push_glob_args *)val;</td> </tr> <tr> <td id="L2803" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2803"></td> <td id="LC2803" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *list;</td> </tr> <tr> <td id="L2804" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2804"></td> <td id="LC2804" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status;</td> </tr> <tr> <td id="L2805" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2805"></td> <td id="LC2805" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2806" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2806"></td> <td id="LC2806" class="blob-code blob-code-inner js-file-line"> list = <span class="pl-c1">glob_make_pattern</span>(path, path + <span class="pl-c1">strlen</span>(path), arg-><span class="pl-smi">flags</span>, enc);</td> </tr> <tr> <td id="L2807" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2807"></td> <td id="LC2807" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!list) {</td> </tr> <tr> <td id="L2808" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2808"></td> <td id="LC2808" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2809" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2809"></td> <td id="LC2809" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2810" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2810"></td> <td id="LC2810" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">glob_helper</span>(arg-><span class="pl-smi">fd</span>, arg-><span class="pl-smi">path</span>, arg-><span class="pl-smi">baselen</span>, arg-><span class="pl-smi">namelen</span>, arg-><span class="pl-smi">dirsep</span>,</td> </tr> <tr> <td id="L2811" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2811"></td> <td id="LC2811" class="blob-code blob-code-inner js-file-line"> arg-><span class="pl-smi">pathtype</span>, &list, &list + <span class="pl-c1">1</span>, arg-><span class="pl-smi">flags</span>, arg-><span class="pl-smi">funcs</span>,</td> </tr> <tr> <td id="L2812" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2812"></td> <td id="LC2812" class="blob-code blob-code-inner js-file-line"> arg-><span class="pl-smi">arg</span>, enc);</td> </tr> <tr> <td id="L2813" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2813"></td> <td id="LC2813" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">glob_free_pattern</span>(list);</td> </tr> <tr> <td id="L2814" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2814"></td> <td id="LC2814" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2815" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2815"></td> <td id="LC2815" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2816" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2816"></td> <td id="LC2816" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2817" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2817"></td> <td id="LC2817" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span> <span class="pl-en">ruby_glob0</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-k">int</span> fd, <span class="pl-k">const</span> <span class="pl-k">char</span> *base, <span class="pl-k">int</span> flags,</td> </tr> <tr> <td id="L2818" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2818"></td> <td id="LC2818" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">ruby_glob_funcs_t</span> *funcs, VALUE arg, rb_encoding *enc);</td> </tr> <tr> <td id="L2819" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2819"></td> <td id="LC2819" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2820" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2820"></td> <td id="LC2820" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> push_glob0_args {</td> </tr> <tr> <td id="L2821" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2821"></td> <td id="LC2821" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd;</td> </tr> <tr> <td id="L2822" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2822"></td> <td id="LC2822" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *base;</td> </tr> <tr> <td id="L2823" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2823"></td> <td id="LC2823" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags;</td> </tr> <tr> <td id="L2824" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2824"></td> <td id="LC2824" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">ruby_glob_funcs_t</span> *funcs;</td> </tr> <tr> <td id="L2825" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2825"></td> <td id="LC2825" class="blob-code blob-code-inner js-file-line"> VALUE arg;</td> </tr> <tr> <td id="L2826" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2826"></td> <td id="LC2826" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L2827" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2827"></td> <td id="LC2827" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2828" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2828"></td> <td id="LC2828" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2829" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2829"></td> <td id="LC2829" class="blob-code blob-code-inner js-file-line"><span class="pl-en">push_glob0_caller</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, VALUE val, <span class="pl-k">void</span> *enc)</td> </tr> <tr> <td id="L2830" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2830"></td> <td id="LC2830" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2831" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2831"></td> <td id="LC2831" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> push_glob0_args *arg = (<span class="pl-k">struct</span> push_glob0_args *)val;</td> </tr> <tr> <td id="L2832" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2832"></td> <td id="LC2832" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">ruby_glob0</span>(path, arg-><span class="pl-smi">fd</span>, arg-><span class="pl-smi">base</span>, arg-><span class="pl-smi">flags</span>, arg-><span class="pl-smi">funcs</span>, arg-><span class="pl-smi">arg</span>, enc);</td> </tr> <tr> <td id="L2833" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2833"></td> <td id="LC2833" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2834" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2834"></td> <td id="LC2834" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2835" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2835"></td> <td id="LC2835" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2836" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2836"></td> <td id="LC2836" class="blob-code blob-code-inner js-file-line"><span class="pl-en">ruby_glob0</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-k">int</span> fd, <span class="pl-k">const</span> <span class="pl-k">char</span> *base, <span class="pl-k">int</span> flags,</td> </tr> <tr> <td id="L2837" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2837"></td> <td id="LC2837" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-c1">ruby_glob_funcs_t</span> *funcs, VALUE arg,</td> </tr> <tr> <td id="L2838" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2838"></td> <td id="LC2838" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc)</td> </tr> <tr> <td id="L2839" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2839"></td> <td id="LC2839" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2840" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2840"></td> <td id="LC2840" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_pattern *list;</td> </tr> <tr> <td id="L2841" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2841"></td> <td id="LC2841" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *root, *start;</td> </tr> <tr> <td id="L2842" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2842"></td> <td id="LC2842" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf;</td> </tr> <tr> <td id="L2843" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2843"></td> <td id="LC2843" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> n, baselen = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2844" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2844"></td> <td id="LC2844" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status, dirsep = <span class="pl-c1">FALSE</span>;</td> </tr> <tr> <td id="L2845" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2845"></td> <td id="LC2845" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2846" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2846"></td> <td id="LC2846" class="blob-code blob-code-inner js-file-line"> start = root = path;</td> </tr> <tr> <td id="L2847" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2847"></td> <td id="LC2847" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2848" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2848"></td> <td id="LC2848" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*root == <span class="pl-s"><span class="pl-pds">'</span>{<span class="pl-pds">'</span></span>) {</td> </tr> <tr> <td id="L2849" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2849"></td> <td id="LC2849" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> push_glob0_args args;</td> </tr> <tr> <td id="L2850" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2850"></td> <td id="LC2850" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">fd</span> = fd;</td> </tr> <tr> <td id="L2851" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2851"></td> <td id="LC2851" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">base</span> = base;</td> </tr> <tr> <td id="L2852" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2852"></td> <td id="LC2852" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">flags</span> = flags;</td> </tr> <tr> <td id="L2853" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2853"></td> <td id="LC2853" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">funcs</span> = funcs;</td> </tr> <tr> <td id="L2854" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2854"></td> <td id="LC2854" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">arg</span> = arg;</td> </tr> <tr> <td id="L2855" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2855"></td> <td id="LC2855" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">ruby_brace_expand</span>(path, flags, push_glob0_caller, (VALUE)&args, enc, Qfalse);</td> </tr> <tr> <td id="L2856" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2856"></td> <td id="LC2856" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2857" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2857"></td> <td id="LC2857" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2858" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2858"></td> <td id="LC2858" class="blob-code blob-code-inner js-file-line"> flags |= FNM_SYSCASE;</td> </tr> <tr> <td id="L2859" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2859"></td> <td id="LC2859" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined DOSISH</td> </tr> <tr> <td id="L2860" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2860"></td> <td id="LC2860" class="blob-code blob-code-inner js-file-line"> root = <span class="pl-c1">rb_enc_path_skip_prefix</span>(root, root + <span class="pl-c1">strlen</span>(root), enc);</td> </tr> <tr> <td id="L2861" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2861"></td> <td id="LC2861" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2862" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2862"></td> <td id="LC2862" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2863" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2863"></td> <td id="LC2863" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*root == <span class="pl-s"><span class="pl-pds">'</span>/<span class="pl-pds">'</span></span>) root++;</td> </tr> <tr> <td id="L2864" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2864"></td> <td id="LC2864" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2865" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2865"></td> <td id="LC2865" class="blob-code blob-code-inner js-file-line"> n = root - start;</td> </tr> <tr> <td id="L2866" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2866"></td> <td id="LC2866" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!n && base) {</td> </tr> <tr> <td id="L2867" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2867"></td> <td id="LC2867" class="blob-code blob-code-inner js-file-line"> n = <span class="pl-c1">strlen</span>(base);</td> </tr> <tr> <td id="L2868" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2868"></td> <td id="LC2868" class="blob-code blob-code-inner js-file-line"> baselen = n;</td> </tr> <tr> <td id="L2869" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2869"></td> <td id="LC2869" class="blob-code blob-code-inner js-file-line"> start = base;</td> </tr> <tr> <td id="L2870" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2870"></td> <td id="LC2870" class="blob-code blob-code-inner js-file-line"> dirsep = <span class="pl-c1">TRUE</span>;</td> </tr> <tr> <td id="L2871" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2871"></td> <td id="LC2871" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2872" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2872"></td> <td id="LC2872" class="blob-code blob-code-inner js-file-line"> buf = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">char</span>, n + <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L2873" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2873"></td> <td id="LC2873" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!buf) <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2874" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2874"></td> <td id="LC2874" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">MEMCPY</span>(buf, start, <span class="pl-k">char</span>, n);</td> </tr> <tr> <td id="L2875" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2875"></td> <td id="LC2875" class="blob-code blob-code-inner js-file-line"> buf[n] = <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\0</span><span class="pl-pds">'</span></span>;</td> </tr> <tr> <td id="L2876" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2876"></td> <td id="LC2876" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2877" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2877"></td> <td id="LC2877" class="blob-code blob-code-inner js-file-line"> list = <span class="pl-c1">glob_make_pattern</span>(root, root + <span class="pl-c1">strlen</span>(root), flags, enc);</td> </tr> <tr> <td id="L2878" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2878"></td> <td id="LC2878" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!list) {</td> </tr> <tr> <td id="L2879" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2879"></td> <td id="LC2879" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(buf);</td> </tr> <tr> <td id="L2880" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2880"></td> <td id="LC2880" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2881" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2881"></td> <td id="LC2881" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2882" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2882"></td> <td id="LC2882" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">glob_helper</span>(fd, buf, baselen, n-baselen, dirsep,</td> </tr> <tr> <td id="L2883" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2883"></td> <td id="LC2883" class="blob-code blob-code-inner js-file-line"> path_unknown, &list, &list + <span class="pl-c1">1</span>,</td> </tr> <tr> <td id="L2884" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2884"></td> <td id="LC2884" class="blob-code blob-code-inner js-file-line"> flags, funcs, arg, enc);</td> </tr> <tr> <td id="L2885" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2885"></td> <td id="LC2885" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">glob_free_pattern</span>(list);</td> </tr> <tr> <td id="L2886" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2886"></td> <td id="LC2886" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(buf);</td> </tr> <tr> <td id="L2887" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2887"></td> <td id="LC2887" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2888" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2888"></td> <td id="LC2888" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2889" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2889"></td> <td id="LC2889" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2890" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2890"></td> <td id="LC2890" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2891" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2891"></td> <td id="LC2891" class="blob-code blob-code-inner js-file-line"><span class="pl-k">int</span></td> </tr> <tr> <td id="L2892" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2892"></td> <td id="LC2892" class="blob-code blob-code-inner js-file-line"><span class="pl-en">ruby_glob</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-k">int</span> flags, ruby_glob_func *func, VALUE arg)</td> </tr> <tr> <td id="L2893" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2893"></td> <td id="LC2893" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2894" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2894"></td> <td id="LC2894" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">ruby_glob_funcs_t</span> funcs;</td> </tr> <tr> <td id="L2895" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2895"></td> <td id="LC2895" class="blob-code blob-code-inner js-file-line"> funcs.<span class="pl-smi">match</span> = func;</td> </tr> <tr> <td id="L2896" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2896"></td> <td id="LC2896" class="blob-code blob-code-inner js-file-line"> funcs.<span class="pl-smi">error</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2897" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2897"></td> <td id="LC2897" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">ruby_glob0</span>(path, AT_FDCWD, <span class="pl-c1">0</span>, flags & ~GLOB_VERBOSE,</td> </tr> <tr> <td id="L2898" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2898"></td> <td id="LC2898" class="blob-code blob-code-inner js-file-line"> &funcs, arg, <span class="pl-c1">rb_ascii8bit_encoding</span>());</td> </tr> <tr> <td id="L2899" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2899"></td> <td id="LC2899" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2900" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2900"></td> <td id="LC2900" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2901" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2901"></td> <td id="LC2901" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2902" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2902"></td> <td id="LC2902" class="blob-code blob-code-inner js-file-line"><span class="pl-en">rb_glob_caller</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, VALUE a, <span class="pl-k">void</span> *enc)</td> </tr> <tr> <td id="L2903" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2903"></td> <td id="LC2903" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2904" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2904"></td> <td id="LC2904" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status;</td> </tr> <tr> <td id="L2905" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2905"></td> <td id="LC2905" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_args *args = (<span class="pl-k">struct</span> glob_args *)a;</td> </tr> <tr> <td id="L2906" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2906"></td> <td id="LC2906" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2907" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2907"></td> <td id="LC2907" class="blob-code blob-code-inner js-file-line"> args-><span class="pl-smi">path</span> = path;</td> </tr> <tr> <td id="L2908" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2908"></td> <td id="LC2908" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_protect</span>(glob_func_caller, a, &status);</td> </tr> <tr> <td id="L2909" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2909"></td> <td id="LC2909" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L2910" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2910"></td> <td id="LC2910" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2911" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2911"></td> <td id="LC2911" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2912" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2912"></td> <td id="LC2912" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">const</span> <span class="pl-c1">ruby_glob_funcs_t</span> rb_glob_funcs = {</td> </tr> <tr> <td id="L2913" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2913"></td> <td id="LC2913" class="blob-code blob-code-inner js-file-line"> rb_glob_caller, rb_glob_error,</td> </tr> <tr> <td id="L2914" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2914"></td> <td id="LC2914" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L2915" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2915"></td> <td id="LC2915" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2916" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2916"></td> <td id="LC2916" class="blob-code blob-code-inner js-file-line"><span class="pl-k">void</span></td> </tr> <tr> <td id="L2917" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2917"></td> <td id="LC2917" class="blob-code blob-code-inner js-file-line"><span class="pl-en">rb_glob</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, <span class="pl-k">void</span> (*func)(<span class="pl-k">const</span> <span class="pl-k">char</span> *, VALUE, <span class="pl-k">void</span> *), VALUE arg)</td> </tr> <tr> <td id="L2918" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2918"></td> <td id="LC2918" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2919" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2919"></td> <td id="LC2919" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_args args;</td> </tr> <tr> <td id="L2920" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2920"></td> <td id="LC2920" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status;</td> </tr> <tr> <td id="L2921" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2921"></td> <td id="LC2921" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2922" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2922"></td> <td id="LC2922" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">func</span> = func;</td> </tr> <tr> <td id="L2923" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2923"></td> <td id="LC2923" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">value</span> = arg;</td> </tr> <tr> <td id="L2924" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2924"></td> <td id="LC2924" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">enc</span> = <span class="pl-c1">rb_ascii8bit_encoding</span>();</td> </tr> <tr> <td id="L2925" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2925"></td> <td id="LC2925" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2926" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2926"></td> <td id="LC2926" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">ruby_glob0</span>(path, AT_FDCWD, <span class="pl-c1">0</span>, GLOB_VERBOSE, &rb_glob_funcs,</td> </tr> <tr> <td id="L2927" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2927"></td> <td id="LC2927" class="blob-code blob-code-inner js-file-line"> (VALUE)&args, args.<span class="pl-smi">enc</span>);</td> </tr> <tr> <td id="L2928" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2928"></td> <td id="LC2928" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-c1">GLOB_JUMP_TAG</span>(status);</td> </tr> <tr> <td id="L2929" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2929"></td> <td id="LC2929" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2930" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2930"></td> <td id="LC2930" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2931" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2931"></td> <td id="LC2931" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span></td> </tr> <tr> <td id="L2932" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2932"></td> <td id="LC2932" class="blob-code blob-code-inner js-file-line"><span class="pl-en">push_pattern</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, VALUE ary, <span class="pl-k">void</span> *enc)</td> </tr> <tr> <td id="L2933" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2933"></td> <td id="LC2933" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2934" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2934"></td> <td id="LC2934" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined _WIN32 || defined __APPLE__</td> </tr> <tr> <td id="L2935" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2935"></td> <td id="LC2935" class="blob-code blob-code-inner js-file-line"> VALUE name = <span class="pl-c1">rb_utf8_str_new_cstr</span>(path);</td> </tr> <tr> <td id="L2936" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2936"></td> <td id="LC2936" class="blob-code blob-code-inner js-file-line"> rb_encoding *eenc = <span class="pl-c1">rb_default_internal_encoding</span>();</td> </tr> <tr> <td id="L2937" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2937"></td> <td id="LC2937" class="blob-code blob-code-inner js-file-line"> name = <span class="pl-c1">rb_str_conv_enc</span>(name, <span class="pl-c1">NULL</span>, eenc ? eenc : enc);</td> </tr> <tr> <td id="L2938" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2938"></td> <td id="LC2938" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">else</span></td> </tr> <tr> <td id="L2939" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2939"></td> <td id="LC2939" class="blob-code blob-code-inner js-file-line"> VALUE name = <span class="pl-c1">rb_external_str_new_with_enc</span>(path, <span class="pl-c1">strlen</span>(path), enc);</td> </tr> <tr> <td id="L2940" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2940"></td> <td id="LC2940" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L2941" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2941"></td> <td id="LC2941" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_ary_push</span>(ary, name);</td> </tr> <tr> <td id="L2942" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2942"></td> <td id="LC2942" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L2943" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2943"></td> <td id="LC2943" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2944" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2944"></td> <td id="LC2944" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L2945" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2945"></td> <td id="LC2945" class="blob-code blob-code-inner js-file-line"><span class="pl-en">ruby_brace_expand</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *str, <span class="pl-k">int</span> flags, ruby_glob_func *func, VALUE arg,</td> </tr> <tr> <td id="L2946" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2946"></td> <td id="LC2946" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc, VALUE var)</td> </tr> <tr> <td id="L2947" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2947"></td> <td id="LC2947" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L2948" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2948"></td> <td id="LC2948" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> escape = !(flags & FNM_NOESCAPE);</td> </tr> <tr> <td id="L2949" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2949"></td> <td id="LC2949" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *p = str;</td> </tr> <tr> <td id="L2950" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2950"></td> <td id="LC2950" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *pend = p + <span class="pl-c1">strlen</span>(p);</td> </tr> <tr> <td id="L2951" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2951"></td> <td id="LC2951" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *s = p;</td> </tr> <tr> <td id="L2952" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2952"></td> <td id="LC2952" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *lbrace = <span class="pl-c1">0</span>, *rbrace = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2953" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2953"></td> <td id="LC2953" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> nest = <span class="pl-c1">0</span>, status = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2954" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2954"></td> <td id="LC2954" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2955" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2955"></td> <td id="LC2955" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (*p) {</td> </tr> <tr> <td id="L2956" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2956"></td> <td id="LC2956" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span>{<span class="pl-pds">'</span></span> && nest++ == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L2957" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2957"></td> <td id="LC2957" class="blob-code blob-code-inner js-file-line"> lbrace = p;</td> </tr> <tr> <td id="L2958" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2958"></td> <td id="LC2958" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2959" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2959"></td> <td id="LC2959" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span>}<span class="pl-pds">'</span></span> && lbrace && --nest == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L2960" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2960"></td> <td id="LC2960" class="blob-code blob-code-inner js-file-line"> rbrace = p;</td> </tr> <tr> <td id="L2961" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2961"></td> <td id="LC2961" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2962" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2962"></td> <td id="LC2962" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2963" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2963"></td> <td id="LC2963" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span> && escape) {</td> </tr> <tr> <td id="L2964" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2964"></td> <td id="LC2964" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!*++p) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2965" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2965"></td> <td id="LC2965" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2966" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2966"></td> <td id="LC2966" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Inc</span>(p, pend, enc);</td> </tr> <tr> <td id="L2967" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2967"></td> <td id="LC2967" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2968" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2968"></td> <td id="LC2968" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2969" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2969"></td> <td id="LC2969" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (lbrace && rbrace) {</td> </tr> <tr> <td id="L2970" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2970"></td> <td id="LC2970" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">size_t</span> len = <span class="pl-c1">strlen</span>(s) + <span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2971" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2971"></td> <td id="LC2971" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">char</span> *buf = <span class="pl-c1">GLOB_ALLOC_N</span>(<span class="pl-k">char</span>, len);</td> </tr> <tr> <td id="L2972" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2972"></td> <td id="LC2972" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> shift;</td> </tr> <tr> <td id="L2973" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2973"></td> <td id="LC2973" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L2974" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2974"></td> <td id="LC2974" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!buf) <span class="pl-k">return</span> -<span class="pl-c1">1</span>;</td> </tr> <tr> <td id="L2975" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2975"></td> <td id="LC2975" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(buf, s, lbrace-s);</td> </tr> <tr> <td id="L2976" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2976"></td> <td id="LC2976" class="blob-code blob-code-inner js-file-line"> shift = (lbrace-s);</td> </tr> <tr> <td id="L2977" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2977"></td> <td id="LC2977" class="blob-code blob-code-inner js-file-line"> p = lbrace;</td> </tr> <tr> <td id="L2978" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2978"></td> <td id="LC2978" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (p < rbrace) {</td> </tr> <tr> <td id="L2979" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2979"></td> <td id="LC2979" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *t = ++p;</td> </tr> <tr> <td id="L2980" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2980"></td> <td id="LC2980" class="blob-code blob-code-inner js-file-line"> nest = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L2981" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2981"></td> <td id="LC2981" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> (p < rbrace && !(*p == <span class="pl-s"><span class="pl-pds">'</span>,<span class="pl-pds">'</span></span> && nest == <span class="pl-c1">0</span>)) {</td> </tr> <tr> <td id="L2982" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2982"></td> <td id="LC2982" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span>{<span class="pl-pds">'</span></span>) nest++;</td> </tr> <tr> <td id="L2983" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2983"></td> <td id="LC2983" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span>}<span class="pl-pds">'</span></span>) nest--;</td> </tr> <tr> <td id="L2984" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2984"></td> <td id="LC2984" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*p == <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\\</span><span class="pl-pds">'</span></span> && escape) {</td> </tr> <tr> <td id="L2985" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2985"></td> <td id="LC2985" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (++p == rbrace) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2986" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2986"></td> <td id="LC2986" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2987" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2987"></td> <td id="LC2987" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Inc</span>(p, pend, enc);</td> </tr> <tr> <td id="L2988" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2988"></td> <td id="LC2988" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2989" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2989"></td> <td id="LC2989" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">memcpy</span>(buf+shift, t, p-t);</td> </tr> <tr> <td id="L2990" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2990"></td> <td id="LC2990" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">strlcpy</span>(buf+shift+(p-t), rbrace+<span class="pl-c1">1</span>, len-(shift+(p-t)));</td> </tr> <tr> <td id="L2991" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2991"></td> <td id="LC2991" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">ruby_brace_expand</span>(buf, flags, func, arg, enc, var);</td> </tr> <tr> <td id="L2992" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2992"></td> <td id="LC2992" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L2993" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2993"></td> <td id="LC2993" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2994" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2994"></td> <td id="LC2994" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">GLOB_FREE</span>(buf);</td> </tr> <tr> <td id="L2995" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2995"></td> <td id="LC2995" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2996" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2996"></td> <td id="LC2996" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-k">if</span> (!lbrace && !rbrace) {</td> </tr> <tr> <td id="L2997" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2997"></td> <td id="LC2997" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">glob_call_func</span>(func, s, arg, enc);</td> </tr> <tr> <td id="L2998" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2998"></td> <td id="LC2998" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L2999" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="2999"></td> <td id="LC2999" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3000" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3000"></td> <td id="LC3000" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_GC_GUARD</span>(var);</td> </tr> <tr> <td id="L3001" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3001"></td> <td id="LC3001" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> status;</td> </tr> <tr> <td id="L3002" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3002"></td> <td id="LC3002" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3003" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3003"></td> <td id="LC3003" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3004" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3004"></td> <td id="LC3004" class="blob-code blob-code-inner js-file-line"><span class="pl-k">struct</span> brace_args {</td> </tr> <tr> <td id="L3005" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3005"></td> <td id="LC3005" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">ruby_glob_funcs_t</span> funcs;</td> </tr> <tr> <td id="L3006" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3006"></td> <td id="LC3006" class="blob-code blob-code-inner js-file-line"> VALUE value;</td> </tr> <tr> <td id="L3007" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3007"></td> <td id="LC3007" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags;</td> </tr> <tr> <td id="L3008" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3008"></td> <td id="LC3008" class="blob-code blob-code-inner js-file-line">};</td> </tr> <tr> <td id="L3009" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3009"></td> <td id="LC3009" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3010" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3010"></td> <td id="LC3010" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L3011" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3011"></td> <td id="LC3011" class="blob-code blob-code-inner js-file-line"><span class="pl-en">glob_brace</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *path, VALUE val, <span class="pl-k">void</span> *enc)</td> </tr> <tr> <td id="L3012" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3012"></td> <td id="LC3012" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3013" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3013"></td> <td id="LC3013" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> brace_args *arg = (<span class="pl-k">struct</span> brace_args *)val;</td> </tr> <tr> <td id="L3014" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3014"></td> <td id="LC3014" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3015" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3015"></td> <td id="LC3015" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">ruby_glob0</span>(path, AT_FDCWD, <span class="pl-c1">0</span>, arg-><span class="pl-smi">flags</span>, &arg-><span class="pl-smi">funcs</span>, arg-><span class="pl-smi">value</span>, enc);</td> </tr> <tr> <td id="L3016" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3016"></td> <td id="LC3016" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3017" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3017"></td> <td id="LC3017" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3018" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3018"></td> <td id="LC3018" class="blob-code blob-code-inner js-file-line"><span class="pl-k">int</span></td> </tr> <tr> <td id="L3019" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3019"></td> <td id="LC3019" class="blob-code blob-code-inner js-file-line"><span class="pl-en">ruby_brace_glob_with_enc</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *str, <span class="pl-k">int</span> flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)</td> </tr> <tr> <td id="L3020" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3020"></td> <td id="LC3020" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3021" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3021"></td> <td id="LC3021" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> brace_args args;</td> </tr> <tr> <td id="L3022" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3022"></td> <td id="LC3022" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3023" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3023"></td> <td id="LC3023" class="blob-code blob-code-inner js-file-line"> flags &= ~GLOB_VERBOSE;</td> </tr> <tr> <td id="L3024" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3024"></td> <td id="LC3024" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">funcs</span>.<span class="pl-smi">match</span> = func;</td> </tr> <tr> <td id="L3025" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3025"></td> <td id="LC3025" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">funcs</span>.<span class="pl-smi">error</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L3026" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3026"></td> <td id="LC3026" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">value</span> = arg;</td> </tr> <tr> <td id="L3027" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3027"></td> <td id="LC3027" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">flags</span> = flags;</td> </tr> <tr> <td id="L3028" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3028"></td> <td id="LC3028" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">ruby_brace_expand</span>(str, flags, glob_brace, (VALUE)&args, enc, Qfalse);</td> </tr> <tr> <td id="L3029" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3029"></td> <td id="LC3029" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3030" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3030"></td> <td id="LC3030" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3031" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3031"></td> <td id="LC3031" class="blob-code blob-code-inner js-file-line"><span class="pl-k">int</span></td> </tr> <tr> <td id="L3032" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3032"></td> <td id="LC3032" class="blob-code blob-code-inner js-file-line"><span class="pl-en">ruby_brace_glob</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *str, <span class="pl-k">int</span> flags, ruby_glob_func *func, VALUE arg)</td> </tr> <tr> <td id="L3033" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3033"></td> <td id="LC3033" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3034" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3034"></td> <td id="LC3034" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">ruby_brace_glob_with_enc</span>(str, flags, func, arg, <span class="pl-c1">rb_ascii8bit_encoding</span>());</td> </tr> <tr> <td id="L3035" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3035"></td> <td id="LC3035" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3036" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3036"></td> <td id="LC3036" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3037" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3037"></td> <td id="LC3037" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L3038" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3038"></td> <td id="LC3038" class="blob-code blob-code-inner js-file-line"><span class="pl-en">push_glob</span>(VALUE ary, VALUE str, VALUE base, <span class="pl-k">int</span> flags)</td> </tr> <tr> <td id="L3039" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3039"></td> <td id="LC3039" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3040" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3040"></td> <td id="LC3040" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> glob_args args;</td> </tr> <tr> <td id="L3041" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3041"></td> <td id="LC3041" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> fd;</td> </tr> <tr> <td id="L3042" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3042"></td> <td id="LC3042" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc = <span class="pl-c1">rb_enc_get</span>(str);</td> </tr> <tr> <td id="L3043" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3043"></td> <td id="LC3043" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3044" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3044"></td> <td id="LC3044" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined _WIN32 || defined __APPLE__</td> </tr> <tr> <td id="L3045" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3045"></td> <td id="LC3045" class="blob-code blob-code-inner js-file-line"> str = <span class="pl-c1">rb_str_encode_ospath</span>(str);</td> </tr> <tr> <td id="L3046" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3046"></td> <td id="LC3046" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L3047" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3047"></td> <td id="LC3047" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_enc_to_index</span>(enc) == ENCINDEX_US_ASCII)</td> </tr> <tr> <td id="L3048" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3048"></td> <td id="LC3048" class="blob-code blob-code-inner js-file-line"> enc = <span class="pl-c1">rb_filesystem_encoding</span>();</td> </tr> <tr> <td id="L3049" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3049"></td> <td id="LC3049" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_enc_to_index</span>(enc) == ENCINDEX_US_ASCII)</td> </tr> <tr> <td id="L3050" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3050"></td> <td id="LC3050" class="blob-code blob-code-inner js-file-line"> enc = <span class="pl-c1">rb_ascii8bit_encoding</span>();</td> </tr> <tr> <td id="L3051" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3051"></td> <td id="LC3051" class="blob-code blob-code-inner js-file-line"> flags |= GLOB_VERBOSE;</td> </tr> <tr> <td id="L3052" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3052"></td> <td id="LC3052" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">func</span> = push_pattern;</td> </tr> <tr> <td id="L3053" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3053"></td> <td id="LC3053" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">value</span> = ary;</td> </tr> <tr> <td id="L3054" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3054"></td> <td id="LC3054" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">enc</span> = enc;</td> </tr> <tr> <td id="L3055" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3055"></td> <td id="LC3055" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">base</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L3056" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3056"></td> <td id="LC3056" class="blob-code blob-code-inner js-file-line"> fd = AT_FDCWD;</td> </tr> <tr> <td id="L3057" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3057"></td> <td id="LC3057" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">NIL_P</span>(base)) {</td> </tr> <tr> <td id="L3058" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3058"></td> <td id="LC3058" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">RB_TYPE_P</span>(base, T_STRING) || !<span class="pl-c1">rb_enc_check</span>(str, base)) {</td> </tr> <tr> <td id="L3059" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3059"></td> <td id="LC3059" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dir_data *dirp = <span class="pl-c1">DATA_PTR</span>(base);</td> </tr> <tr> <td id="L3060" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3060"></td> <td id="LC3060" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dirp-><span class="pl-smi">dir</span>) <span class="pl-c1">dir_closed</span>();</td> </tr> <tr> <td id="L3061" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3061"></td> <td id="LC3061" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">ifdef</span> HAVE_DIRFD</td> </tr> <tr> <td id="L3062" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3062"></td> <td id="LC3062" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> ((fd = <span class="pl-c1">dirfd</span>(dirp-><span class="pl-smi">dir</span>)) == -<span class="pl-c1">1</span>)</td> </tr> <tr> <td id="L3063" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3063"></td> <td id="LC3063" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(<span class="pl-c1">dir_inspect</span>(base));</td> </tr> <tr> <td id="L3064" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3064"></td> <td id="LC3064" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L3065" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3065"></td> <td id="LC3065" class="blob-code blob-code-inner js-file-line"> base = dirp-><span class="pl-smi">path</span>;</td> </tr> <tr> <td id="L3066" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3066"></td> <td id="LC3066" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3067" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3067"></td> <td id="LC3067" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">base</span> = <span class="pl-c1">RSTRING_PTR</span>(base);</td> </tr> <tr> <td id="L3068" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3068"></td> <td id="LC3068" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3069" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3069"></td> <td id="LC3069" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined _WIN32 || defined __APPLE__</td> </tr> <tr> <td id="L3070" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3070"></td> <td id="LC3070" class="blob-code blob-code-inner js-file-line"> enc = <span class="pl-c1">rb_utf8_encoding</span>();</td> </tr> <tr> <td id="L3071" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3071"></td> <td id="LC3071" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L3072" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3072"></td> <td id="LC3072" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3073" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3073"></td> <td id="LC3073" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">ruby_glob0</span>(<span class="pl-c1">RSTRING_PTR</span>(str), fd, args.<span class="pl-smi">base</span>, flags, &rb_glob_funcs,</td> </tr> <tr> <td id="L3074" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3074"></td> <td id="LC3074" class="blob-code blob-code-inner js-file-line"> (VALUE)&args, enc);</td> </tr> <tr> <td id="L3075" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3075"></td> <td id="LC3075" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3076" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3076"></td> <td id="LC3076" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3077" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3077"></td> <td id="LC3077" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3078" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3078"></td> <td id="LC3078" class="blob-code blob-code-inner js-file-line"><span class="pl-en">rb_push_glob</span>(VALUE str, VALUE base, <span class="pl-k">int</span> flags) <span class="pl-c"><span class="pl-c">/*</span> '\0' is delimiter <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3079" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3079"></td> <td id="LC3079" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3080" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3080"></td> <td id="LC3080" class="blob-code blob-code-inner js-file-line"> VALUE ary;</td> </tr> <tr> <td id="L3081" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3081"></td> <td id="LC3081" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status;</td> </tr> <tr> <td id="L3082" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3082"></td> <td id="LC3082" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3083" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3083"></td> <td id="LC3083" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> can contain null bytes as separators <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3084" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3084"></td> <td id="LC3084" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">RB_TYPE_P</span>(str, T_STRING)) {</td> </tr> <tr> <td id="L3085" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3085"></td> <td id="LC3085" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FilePathValue</span>(str);</td> </tr> <tr> <td id="L3086" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3086"></td> <td id="LC3086" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3087" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3087"></td> <td id="LC3087" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> <span class="pl-k">if</span> (!<span class="pl-c1">rb_str_to_cstr</span>(str)) {</td> </tr> <tr> <td id="L3088" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3088"></td> <td id="LC3088" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_raise</span>(rb_eArgError, <span class="pl-s"><span class="pl-pds">"</span>nul-separated glob pattern is deprecated<span class="pl-pds">"</span></span>);</td> </tr> <tr> <td id="L3089" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3089"></td> <td id="LC3089" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3090" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3090"></td> <td id="LC3090" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L3091" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3091"></td> <td id="LC3091" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_enc_check</span>(str, <span class="pl-c1">rb_enc_from_encoding</span>(<span class="pl-c1">rb_usascii_encoding</span>()));</td> </tr> <tr> <td id="L3092" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3092"></td> <td id="LC3092" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3093" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3093"></td> <td id="LC3093" class="blob-code blob-code-inner js-file-line"> ary = <span class="pl-c1">rb_ary_new</span>();</td> </tr> <tr> <td id="L3094" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3094"></td> <td id="LC3094" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3095" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3095"></td> <td id="LC3095" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">push_glob</span>(ary, str, base, flags);</td> </tr> <tr> <td id="L3096" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3096"></td> <td id="LC3096" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-c1">GLOB_JUMP_TAG</span>(status);</td> </tr> <tr> <td id="L3097" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3097"></td> <td id="LC3097" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3098" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3098"></td> <td id="LC3098" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ary;</td> </tr> <tr> <td id="L3099" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3099"></td> <td id="LC3099" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3100" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3100"></td> <td id="LC3100" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3101" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3101"></td> <td id="LC3101" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3102" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3102"></td> <td id="LC3102" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_globs</span>(VALUE args, VALUE base, <span class="pl-k">int</span> flags)</td> </tr> <tr> <td id="L3103" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3103"></td> <td id="LC3103" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3104" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3104"></td> <td id="LC3104" class="blob-code blob-code-inner js-file-line"> VALUE ary = <span class="pl-c1">rb_ary_new</span>();</td> </tr> <tr> <td id="L3105" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3105"></td> <td id="LC3105" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> i;</td> </tr> <tr> <td id="L3106" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3106"></td> <td id="LC3106" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3107" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3107"></td> <td id="LC3107" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (i = <span class="pl-c1">0</span>; i < <span class="pl-c1">RARRAY_LEN</span>(args); ++i) {</td> </tr> <tr> <td id="L3108" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3108"></td> <td id="LC3108" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> status;</td> </tr> <tr> <td id="L3109" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3109"></td> <td id="LC3109" class="blob-code blob-code-inner js-file-line"> VALUE str = <span class="pl-c1">RARRAY_AREF</span>(args, i);</td> </tr> <tr> <td id="L3110" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3110"></td> <td id="LC3110" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FilePathValue</span>(str);</td> </tr> <tr> <td id="L3111" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3111"></td> <td id="LC3111" class="blob-code blob-code-inner js-file-line"> status = <span class="pl-c1">push_glob</span>(ary, str, base, flags);</td> </tr> <tr> <td id="L3112" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3112"></td> <td id="LC3112" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (status) <span class="pl-c1">GLOB_JUMP_TAG</span>(status);</td> </tr> <tr> <td id="L3113" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3113"></td> <td id="LC3113" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3114" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3114"></td> <td id="LC3114" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_GC_GUARD</span>(args);</td> </tr> <tr> <td id="L3115" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3115"></td> <td id="LC3115" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3116" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3116"></td> <td id="LC3116" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ary;</td> </tr> <tr> <td id="L3117" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3117"></td> <td id="LC3117" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3118" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3118"></td> <td id="LC3118" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3119" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3119"></td> <td id="LC3119" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3120" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3120"></td> <td id="LC3120" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_glob_option_base</span>(VALUE base)</td> </tr> <tr> <td id="L3121" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3121"></td> <td id="LC3121" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3122" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3122"></td> <td id="LC3122" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">NIL_OR_UNDEF_P</span>(base)) {</td> </tr> <tr> <td id="L3123" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3123"></td> <td id="LC3123" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L3124" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3124"></td> <td id="LC3124" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3125" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3125"></td> <td id="LC3125" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> USE_OPENDIR_AT</td> </tr> <tr> <td id="L3126" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3126"></td> <td id="LC3126" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_typeddata_is_kind_of</span>(base, &dir_data_type)) {</td> </tr> <tr> <td id="L3127" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3127"></td> <td id="LC3127" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> base;</td> </tr> <tr> <td id="L3128" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3128"></td> <td id="LC3128" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3129" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3129"></td> <td id="LC3129" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L3130" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3130"></td> <td id="LC3130" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FilePathValue</span>(base);</td> </tr> <tr> <td id="L3131" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3131"></td> <td id="LC3131" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">RSTRING_LEN</span>(base)) <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L3132" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3132"></td> <td id="LC3132" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> base;</td> </tr> <tr> <td id="L3133" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3133"></td> <td id="LC3133" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3134" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3134"></td> <td id="LC3134" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3135" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3135"></td> <td id="LC3135" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L3136" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3136"></td> <td id="LC3136" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_glob_option_sort</span>(VALUE sort)</td> </tr> <tr> <td id="L3137" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3137"></td> <td id="LC3137" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3138" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3138"></td> <td id="LC3138" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-c1">rb_bool_expected</span>(sort, <span class="pl-s"><span class="pl-pds">"</span>sort<span class="pl-pds">"</span></span>, <span class="pl-c1">TRUE</span>) ? <span class="pl-c1">0</span> : FNM_GLOB_NOSORT);</td> </tr> <tr> <td id="L3139" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3139"></td> <td id="LC3139" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3140" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3140"></td> <td id="LC3140" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3141" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3141"></td> <td id="LC3141" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3142" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3142"></td> <td id="LC3142" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_aref</span>(<span class="pl-c1">rb_execution_context_t</span> *ec, VALUE obj, VALUE args, VALUE base, VALUE sort)</td> </tr> <tr> <td id="L3143" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3143"></td> <td id="LC3143" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3144" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3144"></td> <td id="LC3144" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> flags = <span class="pl-c1">dir_glob_option_sort</span>(sort);</td> </tr> <tr> <td id="L3145" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3145"></td> <td id="LC3145" class="blob-code blob-code-inner js-file-line"> base = <span class="pl-c1">dir_glob_option_base</span>(base);</td> </tr> <tr> <td id="L3146" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3146"></td> <td id="LC3146" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">RARRAY_LEN</span>(args) == <span class="pl-c1">1</span>) {</td> </tr> <tr> <td id="L3147" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3147"></td> <td id="LC3147" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_push_glob</span>(<span class="pl-c1">RARRAY_AREF</span>(args, <span class="pl-c1">0</span>), base, flags);</td> </tr> <tr> <td id="L3148" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3148"></td> <td id="LC3148" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3149" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3149"></td> <td id="LC3149" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">dir_globs</span>(args, base, flags);</td> </tr> <tr> <td id="L3150" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3150"></td> <td id="LC3150" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3151" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3151"></td> <td id="LC3151" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3152" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3152"></td> <td id="LC3152" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3153" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3153"></td> <td id="LC3153" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_glob</span>(<span class="pl-c1">rb_execution_context_t</span> *ec, VALUE obj, VALUE str, VALUE rflags, VALUE base, VALUE sort)</td> </tr> <tr> <td id="L3154" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3154"></td> <td id="LC3154" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3155" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3155"></td> <td id="LC3155" class="blob-code blob-code-inner js-file-line"> VALUE ary = <span class="pl-c1">rb_check_array_type</span>(str);</td> </tr> <tr> <td id="L3156" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3156"></td> <td id="LC3156" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">int</span> flags = (<span class="pl-c1">NUM2INT</span>(rflags) | <span class="pl-c1">dir_glob_option_sort</span>(sort)) & ~FNM_CASEFOLD;</td> </tr> <tr> <td id="L3157" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3157"></td> <td id="LC3157" class="blob-code blob-code-inner js-file-line"> base = <span class="pl-c1">dir_glob_option_base</span>(base);</td> </tr> <tr> <td id="L3158" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3158"></td> <td id="LC3158" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">NIL_P</span>(ary)) {</td> </tr> <tr> <td id="L3159" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3159"></td> <td id="LC3159" class="blob-code blob-code-inner js-file-line"> ary = <span class="pl-c1">rb_push_glob</span>(str, base, flags);</td> </tr> <tr> <td id="L3160" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3160"></td> <td id="LC3160" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3161" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3161"></td> <td id="LC3161" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L3162" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3162"></td> <td id="LC3162" class="blob-code blob-code-inner js-file-line"> ary = <span class="pl-c1">dir_globs</span>(ary, base, flags);</td> </tr> <tr> <td id="L3163" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3163"></td> <td id="LC3163" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3164" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3164"></td> <td id="LC3164" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3165" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3165"></td> <td id="LC3165" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_block_given_p</span>()) {</td> </tr> <tr> <td id="L3166" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3166"></td> <td id="LC3166" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_ary_each</span>(ary);</td> </tr> <tr> <td id="L3167" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3167"></td> <td id="LC3167" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L3168" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3168"></td> <td id="LC3168" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3169" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3169"></td> <td id="LC3169" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ary;</td> </tr> <tr> <td id="L3170" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3170"></td> <td id="LC3170" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3171" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3171"></td> <td id="LC3171" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3172" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3172"></td> <td id="LC3172" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3173" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3173"></td> <td id="LC3173" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_open_dir</span>(<span class="pl-k">int</span> argc, VALUE *argv)</td> </tr> <tr> <td id="L3174" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3174"></td> <td id="LC3174" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3175" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3175"></td> <td id="LC3175" class="blob-code blob-code-inner js-file-line"> VALUE dir = <span class="pl-c1">rb_funcallv_kw</span>(rb_cDir, <span class="pl-c1">rb_intern</span>(<span class="pl-s"><span class="pl-pds">"</span>open<span class="pl-pds">"</span></span>), argc, argv, RB_PASS_CALLED_KEYWORDS);</td> </tr> <tr> <td id="L3176" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3176"></td> <td id="LC3176" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3177" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3177"></td> <td id="LC3177" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_check_typeddata</span>(dir, &dir_data_type);</td> </tr> <tr> <td id="L3178" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3178"></td> <td id="LC3178" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> dir;</td> </tr> <tr> <td id="L3179" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3179"></td> <td id="LC3179" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3180" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3180"></td> <td id="LC3180" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3181" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3181"></td> <td id="LC3181" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3182" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3182"></td> <td id="LC3182" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3183" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3183"></td> <td id="LC3183" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3184" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3184"></td> <td id="LC3184" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.foreach( dirname ) {| filename | block } -> nil</span></td> </tr> <tr> <td id="L3185" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3185"></td> <td id="LC3185" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.foreach( dirname, encoding: enc ) {| filename | block } -> nil</span></td> </tr> <tr> <td id="L3186" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3186"></td> <td id="LC3186" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.foreach( dirname ) -> an_enumerator</span></td> </tr> <tr> <td id="L3187" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3187"></td> <td id="LC3187" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.foreach( dirname, encoding: enc ) -> an_enumerator</span></td> </tr> <tr> <td id="L3188" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3188"></td> <td id="LC3188" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3189" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3189"></td> <td id="LC3189" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Calls the block once for each entry in the named directory, passing</span></td> </tr> <tr> <td id="L3190" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3190"></td> <td id="LC3190" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * the filename of each entry as a parameter to the block.</span></td> </tr> <tr> <td id="L3191" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3191"></td> <td id="LC3191" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3192" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3192"></td> <td id="LC3192" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * If no block is given, an enumerator is returned instead.</span></td> </tr> <tr> <td id="L3193" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3193"></td> <td id="LC3193" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3194" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3194"></td> <td id="LC3194" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.foreach("testdir") {|x| puts "Got #{x}" }</span></td> </tr> <tr> <td id="L3195" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3195"></td> <td id="LC3195" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3196" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3196"></td> <td id="LC3196" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <em>produces:</em></span></td> </tr> <tr> <td id="L3197" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3197"></td> <td id="LC3197" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3198" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3198"></td> <td id="LC3198" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got .</span></td> </tr> <tr> <td id="L3199" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3199"></td> <td id="LC3199" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got ..</span></td> </tr> <tr> <td id="L3200" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3200"></td> <td id="LC3200" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got config.h</span></td> </tr> <tr> <td id="L3201" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3201"></td> <td id="LC3201" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got main.rb</span></td> </tr> <tr> <td id="L3202" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3202"></td> <td id="LC3202" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3203" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3203"></td> <td id="LC3203" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3204" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3204"></td> <td id="LC3204" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3205" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3205"></td> <td id="LC3205" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_foreach</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE io)</td> </tr> <tr> <td id="L3206" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3206"></td> <td id="LC3206" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3207" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3207"></td> <td id="LC3207" class="blob-code blob-code-inner js-file-line"> VALUE dir;</td> </tr> <tr> <td id="L3208" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3208"></td> <td id="LC3208" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3209" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3209"></td> <td id="LC3209" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN_ENUMERATOR</span>(io, argc, argv);</td> </tr> <tr> <td id="L3210" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3210"></td> <td id="LC3210" class="blob-code blob-code-inner js-file-line"> dir = <span class="pl-c1">dir_open_dir</span>(argc, argv);</td> </tr> <tr> <td id="L3211" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3211"></td> <td id="LC3211" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_ensure</span>(dir_each, dir, dir_close, dir);</td> </tr> <tr> <td id="L3212" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3212"></td> <td id="LC3212" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L3213" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3213"></td> <td id="LC3213" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3214" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3214"></td> <td id="LC3214" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3215" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3215"></td> <td id="LC3215" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3216" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3216"></td> <td id="LC3216" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_collect</span>(VALUE dir)</td> </tr> <tr> <td id="L3217" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3217"></td> <td id="LC3217" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3218" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3218"></td> <td id="LC3218" class="blob-code blob-code-inner js-file-line"> VALUE ary = <span class="pl-c1">rb_ary_new</span>();</td> </tr> <tr> <td id="L3219" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3219"></td> <td id="LC3219" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_each_entry</span>(dir, rb_ary_push, ary, <span class="pl-c1">FALSE</span>);</td> </tr> <tr> <td id="L3220" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3220"></td> <td id="LC3220" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ary;</td> </tr> <tr> <td id="L3221" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3221"></td> <td id="LC3221" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3222" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3222"></td> <td id="LC3222" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3223" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3223"></td> <td id="LC3223" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3224" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3224"></td> <td id="LC3224" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3225" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3225"></td> <td id="LC3225" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.entries( dirname ) -> array</span></td> </tr> <tr> <td id="L3226" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3226"></td> <td id="LC3226" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.entries( dirname, encoding: enc ) -> array</span></td> </tr> <tr> <td id="L3227" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3227"></td> <td id="LC3227" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3228" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3228"></td> <td id="LC3228" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns an array containing all of the filenames in the given</span></td> </tr> <tr> <td id="L3229" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3229"></td> <td id="LC3229" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory. Will raise a SystemCallError if the named directory</span></td> </tr> <tr> <td id="L3230" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3230"></td> <td id="LC3230" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * doesn't exist.</span></td> </tr> <tr> <td id="L3231" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3231"></td> <td id="LC3231" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3232" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3232"></td> <td id="LC3232" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * The optional <i>encoding</i> keyword argument specifies the encoding of the</span></td> </tr> <tr> <td id="L3233" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3233"></td> <td id="LC3233" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory. If not specified, the filesystem encoding is used.</span></td> </tr> <tr> <td id="L3234" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3234"></td> <td id="LC3234" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3235" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3235"></td> <td id="LC3235" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.entries("testdir") #=> [".", "..", "config.h", "main.rb"]</span></td> </tr> <tr> <td id="L3236" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3236"></td> <td id="LC3236" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3237" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3237"></td> <td id="LC3237" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3238" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3238"></td> <td id="LC3238" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3239" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3239"></td> <td id="LC3239" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_entries</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE io)</td> </tr> <tr> <td id="L3240" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3240"></td> <td id="LC3240" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3241" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3241"></td> <td id="LC3241" class="blob-code blob-code-inner js-file-line"> VALUE dir;</td> </tr> <tr> <td id="L3242" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3242"></td> <td id="LC3242" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3243" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3243"></td> <td id="LC3243" class="blob-code blob-code-inner js-file-line"> dir = <span class="pl-c1">dir_open_dir</span>(argc, argv);</td> </tr> <tr> <td id="L3244" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3244"></td> <td id="LC3244" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_ensure</span>(dir_collect, dir, dir_close, dir);</td> </tr> <tr> <td id="L3245" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3245"></td> <td id="LC3245" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3246" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3246"></td> <td id="LC3246" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3247" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3247"></td> <td id="LC3247" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3248" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3248"></td> <td id="LC3248" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_each_child</span>(VALUE dir)</td> </tr> <tr> <td id="L3249" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3249"></td> <td id="LC3249" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3250" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3250"></td> <td id="LC3250" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">dir_each_entry</span>(dir, dir_yield, Qnil, <span class="pl-c1">TRUE</span>);</td> </tr> <tr> <td id="L3251" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3251"></td> <td id="LC3251" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3252" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3252"></td> <td id="LC3252" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3253" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3253"></td> <td id="LC3253" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3254" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3254"></td> <td id="LC3254" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3255" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3255"></td> <td id="LC3255" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.each_child( dirname ) {| filename | block } -> nil</span></td> </tr> <tr> <td id="L3256" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3256"></td> <td id="LC3256" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.each_child( dirname, encoding: enc ) {| filename | block } -> nil</span></td> </tr> <tr> <td id="L3257" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3257"></td> <td id="LC3257" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.each_child( dirname ) -> an_enumerator</span></td> </tr> <tr> <td id="L3258" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3258"></td> <td id="LC3258" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.each_child( dirname, encoding: enc ) -> an_enumerator</span></td> </tr> <tr> <td id="L3259" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3259"></td> <td id="LC3259" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3260" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3260"></td> <td id="LC3260" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Calls the block once for each entry except for "." and ".." in the</span></td> </tr> <tr> <td id="L3261" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3261"></td> <td id="LC3261" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * named directory, passing the filename of each entry as a parameter</span></td> </tr> <tr> <td id="L3262" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3262"></td> <td id="LC3262" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * to the block.</span></td> </tr> <tr> <td id="L3263" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3263"></td> <td id="LC3263" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3264" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3264"></td> <td id="LC3264" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * If no block is given, an enumerator is returned instead.</span></td> </tr> <tr> <td id="L3265" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3265"></td> <td id="LC3265" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3266" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3266"></td> <td id="LC3266" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.each_child("testdir") {|x| puts "Got #{x}" }</span></td> </tr> <tr> <td id="L3267" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3267"></td> <td id="LC3267" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3268" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3268"></td> <td id="LC3268" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <em>produces:</em></span></td> </tr> <tr> <td id="L3269" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3269"></td> <td id="LC3269" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3270" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3270"></td> <td id="LC3270" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got config.h</span></td> </tr> <tr> <td id="L3271" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3271"></td> <td id="LC3271" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got main.rb</span></td> </tr> <tr> <td id="L3272" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3272"></td> <td id="LC3272" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3273" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3273"></td> <td id="LC3273" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3274" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3274"></td> <td id="LC3274" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3275" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3275"></td> <td id="LC3275" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_each_child</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE io)</td> </tr> <tr> <td id="L3276" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3276"></td> <td id="LC3276" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3277" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3277"></td> <td id="LC3277" class="blob-code blob-code-inner js-file-line"> VALUE dir;</td> </tr> <tr> <td id="L3278" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3278"></td> <td id="LC3278" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3279" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3279"></td> <td id="LC3279" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN_ENUMERATOR</span>(io, argc, argv);</td> </tr> <tr> <td id="L3280" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3280"></td> <td id="LC3280" class="blob-code blob-code-inner js-file-line"> dir = <span class="pl-c1">dir_open_dir</span>(argc, argv);</td> </tr> <tr> <td id="L3281" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3281"></td> <td id="LC3281" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_ensure</span>(dir_each_child, dir, dir_close, dir);</td> </tr> <tr> <td id="L3282" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3282"></td> <td id="LC3282" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qnil;</td> </tr> <tr> <td id="L3283" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3283"></td> <td id="LC3283" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3284" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3284"></td> <td id="LC3284" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3285" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3285"></td> <td id="LC3285" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3286" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3286"></td> <td id="LC3286" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3287" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3287"></td> <td id="LC3287" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.each_child {| filename | block } -> dir</span></td> </tr> <tr> <td id="L3288" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3288"></td> <td id="LC3288" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.each_child -> an_enumerator</span></td> </tr> <tr> <td id="L3289" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3289"></td> <td id="LC3289" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3290" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3290"></td> <td id="LC3290" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Calls the block once for each entry except for "." and ".." in</span></td> </tr> <tr> <td id="L3291" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3291"></td> <td id="LC3291" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * this directory, passing the filename of each entry as a parameter</span></td> </tr> <tr> <td id="L3292" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3292"></td> <td id="LC3292" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * to the block.</span></td> </tr> <tr> <td id="L3293" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3293"></td> <td id="LC3293" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3294" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3294"></td> <td id="LC3294" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * If no block is given, an enumerator is returned instead.</span></td> </tr> <tr> <td id="L3295" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3295"></td> <td id="LC3295" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3296" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3296"></td> <td id="LC3296" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir")</span></td> </tr> <tr> <td id="L3297" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3297"></td> <td id="LC3297" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.each_child {|x| puts "Got #{x}" }</span></td> </tr> <tr> <td id="L3298" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3298"></td> <td id="LC3298" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3299" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3299"></td> <td id="LC3299" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <em>produces:</em></span></td> </tr> <tr> <td id="L3300" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3300"></td> <td id="LC3300" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3301" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3301"></td> <td id="LC3301" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got config.h</span></td> </tr> <tr> <td id="L3302" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3302"></td> <td id="LC3302" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Got main.rb</span></td> </tr> <tr> <td id="L3303" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3303"></td> <td id="LC3303" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3304" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3304"></td> <td id="LC3304" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3305" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3305"></td> <td id="LC3305" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3306" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3306"></td> <td id="LC3306" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_each_child_m</span>(VALUE dir)</td> </tr> <tr> <td id="L3307" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3307"></td> <td id="LC3307" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3308" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3308"></td> <td id="LC3308" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RETURN_ENUMERATOR</span>(dir, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3309" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3309"></td> <td id="LC3309" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">dir_each_entry</span>(dir, dir_yield, Qnil, <span class="pl-c1">TRUE</span>);</td> </tr> <tr> <td id="L3310" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3310"></td> <td id="LC3310" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3311" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3311"></td> <td id="LC3311" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3312" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3312"></td> <td id="LC3312" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3313" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3313"></td> <td id="LC3313" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3314" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3314"></td> <td id="LC3314" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * dir.children -> array</span></td> </tr> <tr> <td id="L3315" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3315"></td> <td id="LC3315" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3316" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3316"></td> <td id="LC3316" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns an array containing all of the filenames except for "."</span></td> </tr> <tr> <td id="L3317" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3317"></td> <td id="LC3317" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * and ".." in this directory.</span></td> </tr> <tr> <td id="L3318" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3318"></td> <td id="LC3318" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3319" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3319"></td> <td id="LC3319" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d = Dir.new("testdir")</span></td> </tr> <tr> <td id="L3320" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3320"></td> <td id="LC3320" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * d.children #=> ["config.h", "main.rb"]</span></td> </tr> <tr> <td id="L3321" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3321"></td> <td id="LC3321" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3322" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3322"></td> <td id="LC3322" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3323" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3323"></td> <td id="LC3323" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3324" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3324"></td> <td id="LC3324" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_collect_children</span>(VALUE dir)</td> </tr> <tr> <td id="L3325" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3325"></td> <td id="LC3325" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3326" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3326"></td> <td id="LC3326" class="blob-code blob-code-inner js-file-line"> VALUE ary = <span class="pl-c1">rb_ary_new</span>();</td> </tr> <tr> <td id="L3327" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3327"></td> <td id="LC3327" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">dir_each_entry</span>(dir, rb_ary_push, ary, <span class="pl-c1">TRUE</span>);</td> </tr> <tr> <td id="L3328" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3328"></td> <td id="LC3328" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> ary;</td> </tr> <tr> <td id="L3329" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3329"></td> <td id="LC3329" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3330" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3330"></td> <td id="LC3330" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3331" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3331"></td> <td id="LC3331" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3332" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3332"></td> <td id="LC3332" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3333" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3333"></td> <td id="LC3333" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.children( dirname ) -> array</span></td> </tr> <tr> <td id="L3334" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3334"></td> <td id="LC3334" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.children( dirname, encoding: enc ) -> array</span></td> </tr> <tr> <td id="L3335" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3335"></td> <td id="LC3335" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3336" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3336"></td> <td id="LC3336" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns an array containing all of the filenames except for "."</span></td> </tr> <tr> <td id="L3337" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3337"></td> <td id="LC3337" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * and ".." in the given directory. Will raise a SystemCallError if</span></td> </tr> <tr> <td id="L3338" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3338"></td> <td id="LC3338" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * the named directory doesn't exist.</span></td> </tr> <tr> <td id="L3339" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3339"></td> <td id="LC3339" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3340" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3340"></td> <td id="LC3340" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * The optional <i>encoding</i> keyword argument specifies the encoding of the</span></td> </tr> <tr> <td id="L3341" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3341"></td> <td id="LC3341" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * directory. If not specified, the filesystem encoding is used.</span></td> </tr> <tr> <td id="L3342" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3342"></td> <td id="LC3342" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3343" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3343"></td> <td id="LC3343" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.children("testdir") #=> ["config.h", "main.rb"]</span></td> </tr> <tr> <td id="L3344" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3344"></td> <td id="LC3344" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3345" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3345"></td> <td id="LC3345" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3346" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3346"></td> <td id="LC3346" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3347" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3347"></td> <td id="LC3347" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_children</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE io)</td> </tr> <tr> <td id="L3348" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3348"></td> <td id="LC3348" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3349" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3349"></td> <td id="LC3349" class="blob-code blob-code-inner js-file-line"> VALUE dir;</td> </tr> <tr> <td id="L3350" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3350"></td> <td id="LC3350" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3351" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3351"></td> <td id="LC3351" class="blob-code blob-code-inner js-file-line"> dir = <span class="pl-c1">dir_open_dir</span>(argc, argv);</td> </tr> <tr> <td id="L3352" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3352"></td> <td id="LC3352" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_ensure</span>(dir_collect_children, dir, dir_close, dir);</td> </tr> <tr> <td id="L3353" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3353"></td> <td id="LC3353" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3354" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3354"></td> <td id="LC3354" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3355" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3355"></td> <td id="LC3355" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">int</span></td> </tr> <tr> <td id="L3356" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3356"></td> <td id="LC3356" class="blob-code blob-code-inner js-file-line"><span class="pl-en">fnmatch_brace</span>(<span class="pl-k">const</span> <span class="pl-k">char</span> *pattern, VALUE val, <span class="pl-k">void</span> *enc)</td> </tr> <tr> <td id="L3357" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3357"></td> <td id="LC3357" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3358" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3358"></td> <td id="LC3358" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> brace_args *arg = (<span class="pl-k">struct</span> brace_args *)val;</td> </tr> <tr> <td id="L3359" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3359"></td> <td id="LC3359" class="blob-code blob-code-inner js-file-line"> VALUE path = arg-><span class="pl-smi">value</span>;</td> </tr> <tr> <td id="L3360" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3360"></td> <td id="LC3360" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc_pattern = enc;</td> </tr> <tr> <td id="L3361" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3361"></td> <td id="LC3361" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc_path = <span class="pl-c1">rb_enc_get</span>(path);</td> </tr> <tr> <td id="L3362" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3362"></td> <td id="LC3362" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3363" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3363"></td> <td id="LC3363" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (enc_pattern != enc_path) {</td> </tr> <tr> <td id="L3364" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3364"></td> <td id="LC3364" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">rb_enc_asciicompat</span>(enc_pattern))</td> </tr> <tr> <td id="L3365" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3365"></td> <td id="LC3365" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> FNM_NOMATCH;</td> </tr> <tr> <td id="L3366" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3366"></td> <td id="LC3366" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">rb_enc_asciicompat</span>(enc_path))</td> </tr> <tr> <td id="L3367" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3367"></td> <td id="LC3367" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> FNM_NOMATCH;</td> </tr> <tr> <td id="L3368" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3368"></td> <td id="LC3368" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">rb_enc_str_asciionly_p</span>(path)) {</td> </tr> <tr> <td id="L3369" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3369"></td> <td id="LC3369" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> cr = ENC_CODERANGE_7BIT;</td> </tr> <tr> <td id="L3370" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3370"></td> <td id="LC3370" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">long</span> len = <span class="pl-c1">strlen</span>(pattern);</td> </tr> <tr> <td id="L3371" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3371"></td> <td id="LC3371" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_str_coderange_scan_restartable</span>(pattern, pattern + len,</td> </tr> <tr> <td id="L3372" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3372"></td> <td id="LC3372" class="blob-code blob-code-inner js-file-line"> enc_pattern, &cr) != len)</td> </tr> <tr> <td id="L3373" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3373"></td> <td id="LC3373" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> FNM_NOMATCH;</td> </tr> <tr> <td id="L3374" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3374"></td> <td id="LC3374" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (cr != ENC_CODERANGE_7BIT)</td> </tr> <tr> <td id="L3375" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3375"></td> <td id="LC3375" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> FNM_NOMATCH;</td> </tr> <tr> <td id="L3376" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3376"></td> <td id="LC3376" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3377" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3377"></td> <td id="LC3377" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3378" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3378"></td> <td id="LC3378" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-c1">fnmatch</span>(pattern, enc, <span class="pl-c1">RSTRING_PTR</span>(path), arg-><span class="pl-smi">flags</span>) == <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3379" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3379"></td> <td id="LC3379" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3380" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3380"></td> <td id="LC3380" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3381" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3381"></td> <td id="LC3381" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span> :nodoc: <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3382" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3382"></td> <td id="LC3382" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3383" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3383"></td> <td id="LC3383" class="blob-code blob-code-inner js-file-line"><span class="pl-en">file_s_fnmatch</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE obj)</td> </tr> <tr> <td id="L3384" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3384"></td> <td id="LC3384" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3385" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3385"></td> <td id="LC3385" class="blob-code blob-code-inner js-file-line"> VALUE pattern, path;</td> </tr> <tr> <td id="L3386" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3386"></td> <td id="LC3386" class="blob-code blob-code-inner js-file-line"> VALUE rflags;</td> </tr> <tr> <td id="L3387" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3387"></td> <td id="LC3387" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> flags;</td> </tr> <tr> <td id="L3388" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3388"></td> <td id="LC3388" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3389" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3389"></td> <td id="LC3389" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">rb_scan_args</span>(argc, argv, <span class="pl-s"><span class="pl-pds">"</span>21<span class="pl-pds">"</span></span>, &pattern, &path, &rflags) == <span class="pl-c1">3</span>)</td> </tr> <tr> <td id="L3390" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3390"></td> <td id="LC3390" class="blob-code blob-code-inner js-file-line"> flags = <span class="pl-c1">NUM2INT</span>(rflags);</td> </tr> <tr> <td id="L3391" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3391"></td> <td id="LC3391" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span></td> </tr> <tr> <td id="L3392" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3392"></td> <td id="LC3392" class="blob-code blob-code-inner js-file-line"> flags = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L3393" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3393"></td> <td id="LC3393" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3394" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3394"></td> <td id="LC3394" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">StringValueCStr</span>(pattern);</td> </tr> <tr> <td id="L3395" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3395"></td> <td id="LC3395" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FilePathStringValue</span>(path);</td> </tr> <tr> <td id="L3396" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3396"></td> <td id="LC3396" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3397" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3397"></td> <td id="LC3397" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (flags & FNM_EXTGLOB) {</td> </tr> <tr> <td id="L3398" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3398"></td> <td id="LC3398" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> brace_args args;</td> </tr> <tr> <td id="L3399" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3399"></td> <td id="LC3399" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3400" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3400"></td> <td id="LC3400" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">value</span> = path;</td> </tr> <tr> <td id="L3401" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3401"></td> <td id="LC3401" class="blob-code blob-code-inner js-file-line"> args.<span class="pl-smi">flags</span> = flags;</td> </tr> <tr> <td id="L3402" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3402"></td> <td id="LC3402" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">ruby_brace_expand</span>(<span class="pl-c1">RSTRING_PTR</span>(pattern), flags, fnmatch_brace,</td> </tr> <tr> <td id="L3403" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3403"></td> <td id="LC3403" class="blob-code blob-code-inner js-file-line"> (VALUE)&args, <span class="pl-c1">rb_enc_get</span>(pattern), pattern) > <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L3404" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3404"></td> <td id="LC3404" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qtrue;</td> </tr> <tr> <td id="L3405" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3405"></td> <td id="LC3405" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3406" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3406"></td> <td id="LC3406" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">else</span> {</td> </tr> <tr> <td id="L3407" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3407"></td> <td id="LC3407" class="blob-code blob-code-inner js-file-line"> rb_encoding *enc = <span class="pl-c1">rb_enc_compatible</span>(pattern, path);</td> </tr> <tr> <td id="L3408" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3408"></td> <td id="LC3408" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!enc) <span class="pl-k">return</span> Qfalse;</td> </tr> <tr> <td id="L3409" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3409"></td> <td id="LC3409" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">fnmatch</span>(<span class="pl-c1">RSTRING_PTR</span>(pattern), enc, <span class="pl-c1">RSTRING_PTR</span>(path), flags) == <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L3410" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3410"></td> <td id="LC3410" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qtrue;</td> </tr> <tr> <td id="L3411" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3411"></td> <td id="LC3411" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3412" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3412"></td> <td id="LC3412" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">RB_GC_GUARD</span>(pattern);</td> </tr> <tr> <td id="L3413" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3413"></td> <td id="LC3413" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3414" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3414"></td> <td id="LC3414" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> Qfalse;</td> </tr> <tr> <td id="L3415" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3415"></td> <td id="LC3415" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3416" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3416"></td> <td id="LC3416" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3417" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3417"></td> <td id="LC3417" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3418" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3418"></td> <td id="LC3418" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3419" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3419"></td> <td id="LC3419" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.home() -> "/home/me"</span></td> </tr> <tr> <td id="L3420" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3420"></td> <td id="LC3420" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.home("root") -> "/root"</span></td> </tr> <tr> <td id="L3421" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3421"></td> <td id="LC3421" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3422" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3422"></td> <td id="LC3422" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns the home directory of the current user or the named user</span></td> </tr> <tr> <td id="L3423" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3423"></td> <td id="LC3423" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * if given.</span></td> </tr> <tr> <td id="L3424" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3424"></td> <td id="LC3424" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3425" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3425"></td> <td id="LC3425" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3426" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3426"></td> <td id="LC3426" class="blob-code blob-code-inner js-file-line"><span class="pl-en">dir_s_home</span>(<span class="pl-k">int</span> argc, VALUE *argv, VALUE obj)</td> </tr> <tr> <td id="L3427" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3427"></td> <td id="LC3427" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3428" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3428"></td> <td id="LC3428" class="blob-code blob-code-inner js-file-line"> VALUE user;</td> </tr> <tr> <td id="L3429" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3429"></td> <td id="LC3429" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *u = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L3430" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3430"></td> <td id="LC3430" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3431" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3431"></td> <td id="LC3431" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_check_arity</span>(argc, <span class="pl-c1">0</span>, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3432" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3432"></td> <td id="LC3432" class="blob-code blob-code-inner js-file-line"> user = (argc > <span class="pl-c1">0</span>) ? argv[<span class="pl-c1">0</span>] : Qnil;</td> </tr> <tr> <td id="L3433" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3433"></td> <td id="LC3433" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">NIL_P</span>(user)) {</td> </tr> <tr> <td id="L3434" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3434"></td> <td id="LC3434" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">SafeStringValue</span>(user);</td> </tr> <tr> <td id="L3435" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3435"></td> <td id="LC3435" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_must_asciicompat</span>(user);</td> </tr> <tr> <td id="L3436" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3436"></td> <td id="LC3436" class="blob-code blob-code-inner js-file-line"> u = <span class="pl-c1">StringValueCStr</span>(user);</td> </tr> <tr> <td id="L3437" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3437"></td> <td id="LC3437" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*u) {</td> </tr> <tr> <td id="L3438" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3438"></td> <td id="LC3438" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_home_dir_of</span>(user, <span class="pl-c1">rb_str_new</span>(<span class="pl-c1">0</span>, <span class="pl-c1">0</span>));</td> </tr> <tr> <td id="L3439" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3439"></td> <td id="LC3439" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3440" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3440"></td> <td id="LC3440" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3441" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3441"></td> <td id="LC3441" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">rb_default_home_dir</span>(<span class="pl-c1">rb_str_new</span>(<span class="pl-c1">0</span>, <span class="pl-c1">0</span>));</td> </tr> <tr> <td id="L3442" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3442"></td> <td id="LC3442" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3443" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3443"></td> <td id="LC3443" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3444" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3444"></td> <td id="LC3444" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3445" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3445"></td> <td id="LC3445" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> <span class="pl-c1">0</span></td> </tr> <tr> <td id="L3446" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3446"></td> <td id="LC3446" class="blob-code blob-code-inner js-file-line">/*</td> </tr> <tr> <td id="L3447" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3447"></td> <td id="LC3447" class="blob-code blob-code-inner js-file-line"> * call-seq:</td> </tr> <tr> <td id="L3448" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3448"></td> <td id="LC3448" class="blob-code blob-code-inner js-file-line"> * Dir.exist?(file_name) -> true or false</td> </tr> <tr> <td id="L3449" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3449"></td> <td id="LC3449" class="blob-code blob-code-inner js-file-line"> *</td> </tr> <tr> <td id="L3450" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3450"></td> <td id="LC3450" class="blob-code blob-code-inner js-file-line"> * Returns <code>true</code> if the named file is a directory,</td> </tr> <tr> <td id="L3451" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3451"></td> <td id="LC3451" class="blob-code blob-code-inner js-file-line"> * <code>false</code> otherwise.</td> </tr> <tr> <td id="L3452" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3452"></td> <td id="LC3452" class="blob-code blob-code-inner js-file-line"> *</td> </tr> <tr> <td id="L3453" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3453"></td> <td id="LC3453" class="blob-code blob-code-inner js-file-line"> */</td> </tr> <tr> <td id="L3454" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3454"></td> <td id="LC3454" class="blob-code blob-code-inner js-file-line">VALUE</td> </tr> <tr> <td id="L3455" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3455"></td> <td id="LC3455" class="blob-code blob-code-inner js-file-line">rb_file_directory_p(void)</td> </tr> <tr> <td id="L3456" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3456"></td> <td id="LC3456" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3457" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3457"></td> <td id="LC3457" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3458" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3458"></td> <td id="LC3458" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L3459" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3459"></td> <td id="LC3459" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3460" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3460"></td> <td id="LC3460" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> <span class="pl-k">void</span> *</td> </tr> <tr> <td id="L3461" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3461"></td> <td id="LC3461" class="blob-code blob-code-inner js-file-line"><span class="pl-en">nogvl_dir_empty_p</span>(<span class="pl-k">void</span> *ptr)</td> </tr> <tr> <td id="L3462" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3462"></td> <td id="LC3462" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3463" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3463"></td> <td id="LC3463" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path = ptr;</td> </tr> <tr> <td id="L3464" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3464"></td> <td id="LC3464" class="blob-code blob-code-inner js-file-line"> DIR *dir = <span class="pl-c1">opendir</span>(path);</td> </tr> <tr> <td id="L3465" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3465"></td> <td id="LC3465" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> dirent *dp;</td> </tr> <tr> <td id="L3466" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3466"></td> <td id="LC3466" class="blob-code blob-code-inner js-file-line"> VALUE result = Qtrue;</td> </tr> <tr> <td id="L3467" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3467"></td> <td id="LC3467" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3468" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3468"></td> <td id="LC3468" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!dir) {</td> </tr> <tr> <td id="L3469" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3469"></td> <td id="LC3469" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">int</span> e = errno;</td> </tr> <tr> <td id="L3470" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3470"></td> <td id="LC3470" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (<span class="pl-c1">gc_for_fd_with_gvl</span>(e)) {</td> </tr> <tr> <td id="L3471" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3471"></td> <td id="LC3471" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">default</span>:</td> </tr> <tr> <td id="L3472" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3472"></td> <td id="LC3472" class="blob-code blob-code-inner js-file-line"> dir = <span class="pl-c1">opendir</span>(path);</td> </tr> <tr> <td id="L3473" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3473"></td> <td id="LC3473" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (dir) <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L3474" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3474"></td> <td id="LC3474" class="blob-code blob-code-inner js-file-line"> e = errno;</td> </tr> <tr> <td id="L3475" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3475"></td> <td id="LC3475" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> fall through <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3476" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3476"></td> <td id="LC3476" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-c1">0</span>:</td> </tr> <tr> <td id="L3477" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3477"></td> <td id="LC3477" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (e == ENOTDIR) <span class="pl-k">return</span> (<span class="pl-k">void</span> *)Qfalse;</td> </tr> <tr> <td id="L3478" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3478"></td> <td id="LC3478" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)<span class="pl-c1">INT2FIX</span>(e);</td> </tr> <tr> <td id="L3479" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3479"></td> <td id="LC3479" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3480" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3480"></td> <td id="LC3480" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3481" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3481"></td> <td id="LC3481" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">while</span> ((dp = <span class="pl-c1">READDIR</span>(dir, <span class="pl-c1">NULL</span>)) != <span class="pl-c1">NULL</span>) {</td> </tr> <tr> <td id="L3482" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3482"></td> <td id="LC3482" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (!<span class="pl-c1">to_be_skipped</span>(dp)) {</td> </tr> <tr> <td id="L3483" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3483"></td> <td id="LC3483" class="blob-code blob-code-inner js-file-line"> result = Qfalse;</td> </tr> <tr> <td id="L3484" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3484"></td> <td id="LC3484" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">break</span>;</td> </tr> <tr> <td id="L3485" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3485"></td> <td id="LC3485" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3486" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3486"></td> <td id="LC3486" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3487" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3487"></td> <td id="LC3487" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">closedir</span>(dir);</td> </tr> <tr> <td id="L3488" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3488"></td> <td id="LC3488" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> (<span class="pl-k">void</span> *)result;</td> </tr> <tr> <td id="L3489" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3489"></td> <td id="LC3489" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3490" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3490"></td> <td id="LC3490" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3491" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3491"></td> <td id="LC3491" class="blob-code blob-code-inner js-file-line"><span class="pl-c"><span class="pl-c">/*</span></span></td> </tr> <tr> <td id="L3492" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3492"></td> <td id="LC3492" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * call-seq:</span></td> </tr> <tr> <td id="L3493" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3493"></td> <td id="LC3493" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Dir.empty?(path_name) -> true or false</span></td> </tr> <tr> <td id="L3494" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3494"></td> <td id="LC3494" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3495" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3495"></td> <td id="LC3495" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Returns <code>true</code> if the named file is an empty directory,</span></td> </tr> <tr> <td id="L3496" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3496"></td> <td id="LC3496" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * <code>false</code> if it is not a directory or non-empty.</span></td> </tr> <tr> <td id="L3497" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3497"></td> <td id="LC3497" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3498" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3498"></td> <td id="LC3498" class="blob-code blob-code-inner js-file-line"><span class="pl-k">static</span> VALUE</td> </tr> <tr> <td id="L3499" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3499"></td> <td id="LC3499" class="blob-code blob-code-inner js-file-line"><span class="pl-en">rb_dir_s_empty_p</span>(VALUE obj, VALUE dirname)</td> </tr> <tr> <td id="L3500" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3500"></td> <td id="LC3500" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3501" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3501"></td> <td id="LC3501" class="blob-code blob-code-inner js-file-line"> VALUE result, orig;</td> </tr> <tr> <td id="L3502" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3502"></td> <td id="LC3502" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-k">char</span> *path;</td> </tr> <tr> <td id="L3503" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3503"></td> <td id="LC3503" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">enum</span> {false_on_notdir = <span class="pl-c1">1</span>};</td> </tr> <tr> <td id="L3504" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3504"></td> <td id="LC3504" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3505" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3505"></td> <td id="LC3505" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">FilePathValue</span>(dirname);</td> </tr> <tr> <td id="L3506" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3506"></td> <td id="LC3506" class="blob-code blob-code-inner js-file-line"> orig = <span class="pl-c1">rb_str_dup_frozen</span>(dirname);</td> </tr> <tr> <td id="L3507" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3507"></td> <td id="LC3507" class="blob-code blob-code-inner js-file-line"> dirname = <span class="pl-c1">rb_str_encode_ospath</span>(dirname);</td> </tr> <tr> <td id="L3508" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3508"></td> <td id="LC3508" class="blob-code blob-code-inner js-file-line"> dirname = <span class="pl-c1">rb_str_dup_frozen</span>(dirname);</td> </tr> <tr> <td id="L3509" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3509"></td> <td id="LC3509" class="blob-code blob-code-inner js-file-line"> path = <span class="pl-c1">RSTRING_PTR</span>(dirname);</td> </tr> <tr> <td id="L3510" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3510"></td> <td id="LC3510" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3511" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3511"></td> <td id="LC3511" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">if</span> defined HAVE_GETATTRLIST && defined ATTR_DIR_ENTRYCOUNT</td> </tr> <tr> <td id="L3512" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3512"></td> <td id="LC3512" class="blob-code blob-code-inner js-file-line"> {</td> </tr> <tr> <td id="L3513" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3513"></td> <td id="LC3513" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">u_int32_t</span> attrbuf[<span class="pl-c1">SIZEUP32</span>(<span class="pl-c1">fsobj_tag_t</span>)];</td> </tr> <tr> <td id="L3514" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3514"></td> <td id="LC3514" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">struct</span> attrlist al = {ATTR_BIT_MAP_COUNT, <span class="pl-c1">0</span>, ATTR_CMN_OBJTAG,};</td> </tr> <tr> <td id="L3515" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3515"></td> <td id="LC3515" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">getattrlist</span>(path, &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), <span class="pl-c1">0</span>) != <span class="pl-c1">0</span>)</td> </tr> <tr> <td id="L3516" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3516"></td> <td id="LC3516" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(orig);</td> </tr> <tr> <td id="L3517" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3517"></td> <td id="LC3517" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (*(<span class="pl-k">const</span> <span class="pl-c1">fsobj_tag_t</span> *)(attrbuf+<span class="pl-c1">1</span>) == VT_HFS) {</td> </tr> <tr> <td id="L3518" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3518"></td> <td id="LC3518" class="blob-code blob-code-inner js-file-line"> al.<span class="pl-smi">commonattr</span> = <span class="pl-c1">0</span>;</td> </tr> <tr> <td id="L3519" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3519"></td> <td id="LC3519" class="blob-code blob-code-inner js-file-line"> al.<span class="pl-smi">dirattr</span> = ATTR_DIR_ENTRYCOUNT;</td> </tr> <tr> <td id="L3520" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3520"></td> <td id="LC3520" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">getattrlist</span>(path, &al, attrbuf, <span class="pl-k">sizeof</span>(attrbuf), <span class="pl-c1">0</span>) == <span class="pl-c1">0</span>) {</td> </tr> <tr> <td id="L3521" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3521"></td> <td id="LC3521" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (attrbuf[<span class="pl-c1">0</span>] >= <span class="pl-c1">2</span> * <span class="pl-k">sizeof</span>(<span class="pl-c1">u_int32_t</span>))</td> </tr> <tr> <td id="L3522" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3522"></td> <td id="LC3522" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">RBOOL</span>(attrbuf[<span class="pl-c1">1</span>] == <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3523" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3523"></td> <td id="LC3523" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (false_on_notdir) <span class="pl-k">return</span> Qfalse;</td> </tr> <tr> <td id="L3524" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3524"></td> <td id="LC3524" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3525" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3525"></td> <td id="LC3525" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_sys_fail_path</span>(orig);</td> </tr> <tr> <td id="L3526" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3526"></td> <td id="LC3526" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3527" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3527"></td> <td id="LC3527" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3528" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3528"></td> <td id="LC3528" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">endif</span></td> </tr> <tr> <td id="L3529" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3529"></td> <td id="LC3529" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3530" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3530"></td> <td id="LC3530" class="blob-code blob-code-inner js-file-line"> result = (VALUE)<span class="pl-c1">rb_thread_call_without_gvl</span>(nogvl_dir_empty_p, (<span class="pl-k">void</span> *)path,</td> </tr> <tr> <td id="L3531" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3531"></td> <td id="LC3531" class="blob-code blob-code-inner js-file-line"> RUBY_UBF_IO, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3532" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3532"></td> <td id="LC3532" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">FIXNUM_P</span>(result)) {</td> </tr> <tr> <td id="L3533" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3533"></td> <td id="LC3533" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_syserr_fail_path</span>((<span class="pl-k">int</span>)<span class="pl-c1">FIX2LONG</span>(result), orig);</td> </tr> <tr> <td id="L3534" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3534"></td> <td id="LC3534" class="blob-code blob-code-inner js-file-line"> }</td> </tr> <tr> <td id="L3535" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3535"></td> <td id="LC3535" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> result;</td> </tr> <tr> <td id="L3536" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3536"></td> <td id="LC3536" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3537" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3537"></td> <td id="LC3537" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3538" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3538"></td> <td id="LC3538" class="blob-code blob-code-inner js-file-line"><span class="pl-k">void</span></td> </tr> <tr> <td id="L3539" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3539"></td> <td id="LC3539" class="blob-code blob-code-inner js-file-line"><span class="pl-en">Init_Dir</span>(<span class="pl-k">void</span>)</td> </tr> <tr> <td id="L3540" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3540"></td> <td id="LC3540" class="blob-code blob-code-inner js-file-line">{</td> </tr> <tr> <td id="L3541" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3541"></td> <td id="LC3541" class="blob-code blob-code-inner js-file-line"> rb_cDir = <span class="pl-c1">rb_define_class</span>(<span class="pl-s"><span class="pl-pds">"</span>Dir<span class="pl-pds">"</span></span>, rb_cObject);</td> </tr> <tr> <td id="L3542" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3542"></td> <td id="LC3542" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3543" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3543"></td> <td id="LC3543" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_include_module</span>(rb_cDir, rb_mEnumerable);</td> </tr> <tr> <td id="L3544" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3544"></td> <td id="LC3544" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3545" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3545"></td> <td id="LC3545" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_alloc_func</span>(rb_cDir, dir_s_alloc);</td> </tr> <tr> <td id="L3546" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3546"></td> <td id="LC3546" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>for_fd<span class="pl-pds">"</span></span>, dir_s_for_fd, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3547" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3547"></td> <td id="LC3547" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir, <span class="pl-s"><span class="pl-pds">"</span>foreach<span class="pl-pds">"</span></span>, dir_foreach, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3548" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3548"></td> <td id="LC3548" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir, <span class="pl-s"><span class="pl-pds">"</span>entries<span class="pl-pds">"</span></span>, dir_entries, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3549" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3549"></td> <td id="LC3549" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir, <span class="pl-s"><span class="pl-pds">"</span>each_child<span class="pl-pds">"</span></span>, dir_s_each_child, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3550" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3550"></td> <td id="LC3550" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir, <span class="pl-s"><span class="pl-pds">"</span>children<span class="pl-pds">"</span></span>, dir_s_children, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3551" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3551"></td> <td id="LC3551" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3552" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3552"></td> <td id="LC3552" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>fileno<span class="pl-pds">"</span></span>, dir_fileno, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3553" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3553"></td> <td id="LC3553" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>path<span class="pl-pds">"</span></span>, dir_path, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3554" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3554"></td> <td id="LC3554" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>to_path<span class="pl-pds">"</span></span>, dir_path, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3555" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3555"></td> <td id="LC3555" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>inspect<span class="pl-pds">"</span></span>, dir_inspect, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3556" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3556"></td> <td id="LC3556" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>read<span class="pl-pds">"</span></span>, dir_read, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3557" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3557"></td> <td id="LC3557" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>each<span class="pl-pds">"</span></span>, dir_each, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3558" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3558"></td> <td id="LC3558" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>each_child<span class="pl-pds">"</span></span>, dir_each_child_m, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3559" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3559"></td> <td id="LC3559" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>children<span class="pl-pds">"</span></span>, dir_collect_children, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3560" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3560"></td> <td id="LC3560" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>rewind<span class="pl-pds">"</span></span>, dir_rewind, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3561" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3561"></td> <td id="LC3561" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>tell<span class="pl-pds">"</span></span>, dir_tell, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3562" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3562"></td> <td id="LC3562" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>seek<span class="pl-pds">"</span></span>, dir_seek, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3563" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3563"></td> <td id="LC3563" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>pos<span class="pl-pds">"</span></span>, dir_tell, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3564" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3564"></td> <td id="LC3564" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>pos=<span class="pl-pds">"</span></span>, dir_set_pos, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3565" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3565"></td> <td id="LC3565" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>close<span class="pl-pds">"</span></span>, dir_close, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3566" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3566"></td> <td id="LC3566" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>chdir<span class="pl-pds">"</span></span>, dir_chdir, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3567" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3567"></td> <td id="LC3567" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3568" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3568"></td> <td id="LC3568" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>fchdir<span class="pl-pds">"</span></span>, dir_s_fchdir, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3569" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3569"></td> <td id="LC3569" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>chdir<span class="pl-pds">"</span></span>, dir_s_chdir, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3570" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3570"></td> <td id="LC3570" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>getwd<span class="pl-pds">"</span></span>, dir_s_getwd, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3571" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3571"></td> <td id="LC3571" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>pwd<span class="pl-pds">"</span></span>, dir_s_getwd, <span class="pl-c1">0</span>);</td> </tr> <tr> <td id="L3572" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3572"></td> <td id="LC3572" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>chroot<span class="pl-pds">"</span></span>, dir_s_chroot, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3573" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3573"></td> <td id="LC3573" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>mkdir<span class="pl-pds">"</span></span>, dir_s_mkdir, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3574" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3574"></td> <td id="LC3574" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>rmdir<span class="pl-pds">"</span></span>, dir_s_rmdir, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3575" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3575"></td> <td id="LC3575" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>delete<span class="pl-pds">"</span></span>, dir_s_rmdir, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3576" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3576"></td> <td id="LC3576" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>unlink<span class="pl-pds">"</span></span>, dir_s_rmdir, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3577" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3577"></td> <td id="LC3577" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>home<span class="pl-pds">"</span></span>, dir_s_home, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3578" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3578"></td> <td id="LC3578" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3579" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3579"></td> <td id="LC3579" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>exist?<span class="pl-pds">"</span></span>, rb_file_directory_p, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3580" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3580"></td> <td id="LC3580" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cDir,<span class="pl-s"><span class="pl-pds">"</span>empty?<span class="pl-pds">"</span></span>, rb_dir_s_empty_p, <span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3581" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3581"></td> <td id="LC3581" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3582" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3582"></td> <td id="LC3582" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cFile,<span class="pl-s"><span class="pl-pds">"</span>fnmatch<span class="pl-pds">"</span></span>, file_s_fnmatch, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3583" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3583"></td> <td id="LC3583" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_define_singleton_method</span>(rb_cFile,<span class="pl-s"><span class="pl-pds">"</span>fnmatch?<span class="pl-pds">"</span></span>, file_s_fnmatch, -<span class="pl-c1">1</span>);</td> </tr> <tr> <td id="L3584" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3584"></td> <td id="LC3584" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3585" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3585"></td> <td id="LC3585" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Document-const: File::Constants::FNM_NOESCAPE</span></td> </tr> <tr> <td id="L3586" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3586"></td> <td id="LC3586" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3587" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3587"></td> <td id="LC3587" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Disables escapes in File.fnmatch and Dir.glob patterns</span></td> </tr> <tr> <td id="L3588" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3588"></td> <td id="LC3588" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3589" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3589"></td> <td id="LC3589" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_file_const</span>(<span class="pl-s"><span class="pl-pds">"</span>FNM_NOESCAPE<span class="pl-pds">"</span></span>, <span class="pl-c1">INT2FIX</span>(FNM_NOESCAPE));</td> </tr> <tr> <td id="L3590" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3590"></td> <td id="LC3590" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3591" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3591"></td> <td id="LC3591" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Document-const: File::Constants::FNM_PATHNAME</span></td> </tr> <tr> <td id="L3592" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3592"></td> <td id="LC3592" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3593" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3593"></td> <td id="LC3593" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Wildcards in File.fnmatch and Dir.glob patterns do not match directory</span></td> </tr> <tr> <td id="L3594" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3594"></td> <td id="LC3594" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * separators</span></td> </tr> <tr> <td id="L3595" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3595"></td> <td id="LC3595" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3596" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3596"></td> <td id="LC3596" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_file_const</span>(<span class="pl-s"><span class="pl-pds">"</span>FNM_PATHNAME<span class="pl-pds">"</span></span>, <span class="pl-c1">INT2FIX</span>(FNM_PATHNAME));</td> </tr> <tr> <td id="L3597" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3597"></td> <td id="LC3597" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3598" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3598"></td> <td id="LC3598" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Document-const: File::Constants::FNM_DOTMATCH</span></td> </tr> <tr> <td id="L3599" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3599"></td> <td id="LC3599" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3600" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3600"></td> <td id="LC3600" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * The '*' wildcard matches filenames starting with "." in File.fnmatch</span></td> </tr> <tr> <td id="L3601" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3601"></td> <td id="LC3601" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * and Dir.glob patterns</span></td> </tr> <tr> <td id="L3602" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3602"></td> <td id="LC3602" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3603" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3603"></td> <td id="LC3603" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_file_const</span>(<span class="pl-s"><span class="pl-pds">"</span>FNM_DOTMATCH<span class="pl-pds">"</span></span>, <span class="pl-c1">INT2FIX</span>(FNM_DOTMATCH));</td> </tr> <tr> <td id="L3604" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3604"></td> <td id="LC3604" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3605" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3605"></td> <td id="LC3605" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Document-const: File::Constants::FNM_CASEFOLD</span></td> </tr> <tr> <td id="L3606" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3606"></td> <td id="LC3606" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3607" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3607"></td> <td id="LC3607" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Makes File.fnmatch patterns case insensitive (but not Dir.glob</span></td> </tr> <tr> <td id="L3608" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3608"></td> <td id="LC3608" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * patterns).</span></td> </tr> <tr> <td id="L3609" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3609"></td> <td id="LC3609" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3610" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3610"></td> <td id="LC3610" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_file_const</span>(<span class="pl-s"><span class="pl-pds">"</span>FNM_CASEFOLD<span class="pl-pds">"</span></span>, <span class="pl-c1">INT2FIX</span>(FNM_CASEFOLD));</td> </tr> <tr> <td id="L3611" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3611"></td> <td id="LC3611" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3612" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3612"></td> <td id="LC3612" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Document-const: File::Constants::FNM_EXTGLOB</span></td> </tr> <tr> <td id="L3613" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3613"></td> <td id="LC3613" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3614" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3614"></td> <td id="LC3614" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Allows file globbing through "{a,b}" in File.fnmatch patterns.</span></td> </tr> <tr> <td id="L3615" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3615"></td> <td id="LC3615" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3616" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3616"></td> <td id="LC3616" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_file_const</span>(<span class="pl-s"><span class="pl-pds">"</span>FNM_EXTGLOB<span class="pl-pds">"</span></span>, <span class="pl-c1">INT2FIX</span>(FNM_EXTGLOB));</td> </tr> <tr> <td id="L3617" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3617"></td> <td id="LC3617" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3618" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3618"></td> <td id="LC3618" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Document-const: File::Constants::FNM_SYSCASE</span></td> </tr> <tr> <td id="L3619" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3619"></td> <td id="LC3619" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3620" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3620"></td> <td id="LC3620" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * System default case insensitiveness, equals to FNM_CASEFOLD or</span></td> </tr> <tr> <td id="L3621" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3621"></td> <td id="LC3621" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * 0.</span></td> </tr> <tr> <td id="L3622" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3622"></td> <td id="LC3622" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3623" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3623"></td> <td id="LC3623" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_file_const</span>(<span class="pl-s"><span class="pl-pds">"</span>FNM_SYSCASE<span class="pl-pds">"</span></span>, <span class="pl-c1">INT2FIX</span>(FNM_SYSCASE));</td> </tr> <tr> <td id="L3624" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3624"></td> <td id="LC3624" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3625" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3625"></td> <td id="LC3625" class="blob-code blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">/*</span> Document-const: File::Constants::FNM_SHORTNAME</span></td> </tr> <tr> <td id="L3626" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3626"></td> <td id="LC3626" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> *</span></td> </tr> <tr> <td id="L3627" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3627"></td> <td id="LC3627" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Makes patterns to match short names if existing. Valid only</span></td> </tr> <tr> <td id="L3628" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3628"></td> <td id="LC3628" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * on Microsoft Windows.</span></td> </tr> <tr> <td id="L3629" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3629"></td> <td id="LC3629" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> <span class="pl-c">*/</span></span></td> </tr> <tr> <td id="L3630" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3630"></td> <td id="LC3630" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">rb_file_const</span>(<span class="pl-s"><span class="pl-pds">"</span>FNM_SHORTNAME<span class="pl-pds">"</span></span>, <span class="pl-c1">INT2FIX</span>(FNM_SHORTNAME));</td> </tr> <tr> <td id="L3631" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3631"></td> <td id="LC3631" class="blob-code blob-code-inner js-file-line">}</td> </tr> <tr> <td id="L3632" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3632"></td> <td id="LC3632" class="blob-code blob-code-inner js-file-line"> </td> </tr> <tr> <td id="L3633" class="blob-num js-line-number js-code-nav-line-number js-blob-rnum" data-line-number="3633"></td> <td id="LC3633" class="blob-code blob-code-inner js-file-line">#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>dir.rbinc<span class="pl-pds">"</span></span></td> </tr> </table> </div> <details class="details-reset details-overlay BlobToolbar position-absolute js-file-line-actions dropdown d-none" aria-hidden="true"> <summary class="btn-octicon ml-0 px-2 p-0 color-bg-default border color-border-default rounded-2" aria-label="Inline file action toolbar"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </summary> <details-menu> <ul class="BlobToolbar-dropdown dropdown-menu dropdown-menu-se ml-2 mt-2" style="width:185px"> <li> <clipboard-copy role="menuitem" class="dropdown-item" id="js-copy-lines" style="cursor:pointer;" aria-label="Copy lines"> Copy lines </clipboard-copy> </li> <li> <clipboard-copy role="menuitem" class="dropdown-item" id="js-copy-permalink" style="cursor:pointer;" aria-label="Copy permalink"> Copy permalink </clipboard-copy> </li> <li><a class="dropdown-item js-update-url-with-hash" id="js-view-git-blame" role="menuitem" href="/web/20230614175204/https://github.com/ruby/ruby/blame/813a5f4fc46a24ca1695d23c159250b9e1080ac7/dir.c">View git blame</a></li> </ul> </details-menu> </details> </div> </div> <details class="details-reset details-overlay details-overlay-dark" id="jumpto-line-details-dialog"> <summary data-hotkey="l" aria-label="Jump to line"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast linejump overflow-hidden" aria-label="Jump to line"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-jump-to-line-form Box-body d-flex" data-turbo="false" action="" accept-charset="UTF-8" method="get"> <input class="form-control flex-auto mr-3 linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line…" aria-label="Jump to line" autofocus> <button data-close-dialog="" type="submit" data-view-component="true" class="btn"> Go </button> </form> </details-dialog> </details> </div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer width-full container-xl p-responsive" role="contentinfo"> <h2 class="sr-only">Footer</h2> <div class="position-relative d-flex flex-items-center pb-2 f6 color-fg-muted border-top color-border-muted flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap mt-6 pt-6"> <div class="list-style-none d-flex flex-wrap col-0 col-lg-2 flex-justify-start flex-lg-justify-between mb-2 mb-lg-0"> <div class="mt-2 mt-lg-0 d-flex flex-items-center"> <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://web.archive.org/web/20230614175204/https://github.com/"> <svg aria-hidden="true" height="24" viewbox="0 0 16 16" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path> </svg> </a> <span> © 2023 GitHub, Inc. </span> </div> </div> <nav aria-label="Footer" class="col-12 col-lg-8"> <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3> <ul class="list-style-none d-flex flex-wrap col-12 flex-justify-center flex-lg-justify-between mb-2 mb-lg-0" aria-labelledby="sr-footer-heading"> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-analytics-event="{"category":"Footer","action":"go to terms","label":"text:terms"}">Terms</a></li> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-analytics-event="{"category":"Footer","action":"go to privacy","label":"text:privacy"}">Privacy</a></li> <li class="mr-3 mr-lg-0"><a data-analytics-event="{"category":"Footer","action":"go to security","label":"text:security"}" href="https://web.archive.org/web/20230614175204/https://github.com/security">Security</a></li> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://www.githubstatus.com/" data-analytics-event="{"category":"Footer","action":"go to status","label":"text:status"}">Status</a></li> <li class="mr-3 mr-lg-0"><a data-ga-click="Footer, go to help, text:Docs" href="https://web.archive.org/web/20230614175204/https://docs.github.com/">Docs</a></li> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://support.github.com/?tags=dotcom-footer" data-analytics-event="{"category":"Footer","action":"go to contact","label":"text:contact"}">Contact GitHub</a></li> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://github.com/pricing" data-analytics-event="{"category":"Footer","action":"go to Pricing","label":"text:Pricing"}">Pricing</a></li> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://docs.github.com/" data-analytics-event="{"category":"Footer","action":"go to api","label":"text:api"}">API</a></li> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://services.github.com/" data-analytics-event="{"category":"Footer","action":"go to training","label":"text:training"}">Training</a></li> <li class="mr-3 mr-lg-0"><a href="https://web.archive.org/web/20230614175204/https://github.blog/" data-analytics-event="{"category":"Footer","action":"go to blog","label":"text:blog"}">Blog</a></li> <li><a data-ga-click="Footer, go to about, text:about" href="https://web.archive.org/web/20230614175204/https://github.com/about">About</a></li> </ul> </nav> </div> <div class="d-flex flex-justify-center pb-6"> <span class="f6 color-fg-muted"></span> </div> </footer> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> You can’t perform that action at this time. </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details> </template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div> </div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0 tooltipped-no-delay" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> <template id="snippet-clipboard-copy-button-unpositioned"> <div class="zeroclipboard-container"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 tooltipped-no-delay d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewbox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> </div> <div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite"></div> </body> </html> <!-- FILE ARCHIVED ON 17:52:04 Jun 14, 2023 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 20:11:08 Dec 11, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 2.451 exclusion.robots: 0.043 exclusion.robots.policy: 0.026 esindex: 0.018 cdx.remote: 27.254 LoadShardBlock: 302.123 (3) PetaboxLoader3.datanode: 109.401 (4) PetaboxLoader3.resolve: 3342.828 (2) load_resource: 3221.385 -->